diff options
author | Dominik Picheta <dominikpicheta@gmail.com> | 2016-09-18 18:15:20 +0200 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@gmail.com> | 2016-09-18 18:15:20 +0200 |
commit | 1740619c0cd3f94c2fe16560d44402daca449e53 (patch) | |
tree | fefdff04e8766e2caebf25d5b7ae7090a9ced123 /tests | |
parent | 2864c346e381c0bd020b95e6ddd7fbd5b5630c0c (diff) | |
download | Nim-1740619c0cd3f94c2fe16560d44402daca449e53.tar.gz |
Implements {.multisync.} pragma for async and sync proc combos.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/async/tmultisync.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/async/tmultisync.nim b/tests/async/tmultisync.nim new file mode 100644 index 000000000..9ef9b105c --- /dev/null +++ b/tests/async/tmultisync.nim @@ -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 + |