Implements {.multisync.} pragma for async and sync proc combos.

This commit is contained in:
Dominik Picheta 2016-09-18 18:15:20 +02:00
commit 1740619c0c
2 changed files with 118 additions and 0 deletions

View file

@ -0,0 +1,8 @@
import asyncdispatch, net, asyncnet
proc recvTwice(socket: Socket | AsyncSocket,
size: int): Future[string] {.multisync.} =
var x = await socket.recv(size)
var y = await socket.recv(size+1)
return x & "aboo" & y