summary refs log tree commit diff stats
path: root/lib/pure/asyncdispatch.nim
diff options
context:
space:
mode:
authorMathias Stearn <redbeard0531@gmail.com>2017-12-08 19:55:04 -0500
committerDominik Picheta <dominikpicheta@googlemail.com>2017-12-09 00:55:04 +0000
commitb87ef6553201c73e24b1b53641cc18abe17d6e9b (patch)
treea6e5a04418c19ada27b4a108d07532c4cacf3cae /lib/pure/asyncdispatch.nim
parentf70d967d2c313fc92ca864cbe856c55c40947aae (diff)
downloadNim-b87ef6553201c73e24b1b53641cc18abe17d6e9b.tar.gz
Use addCallback rather than callback= in asyncfutures.all() (#6850)
* Use addCallback rather than callback= in asyncfutures.all()

Addresses part of #6849

* Stop using do notation for #6849

* Update example style
Diffstat (limited to 'lib/pure/asyncdispatch.nim')
-rw-r--r--lib/pure/asyncdispatch.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/pure/asyncdispatch.nim b/lib/pure/asyncdispatch.nim
index 4c96aa614..a71d30ab9 100644
--- a/lib/pure/asyncdispatch.nim
+++ b/lib/pure/asyncdispatch.nim
@@ -59,9 +59,10 @@ export asyncfutures, asyncstreams
 ##
 ##   .. code-block::nim
 ##      var future = socket.recv(100)
-##      future.callback =
+##      future.addCallback(
 ##        proc () =
 ##          echo(future.read)
+##      )
 ##
 ## All asynchronous functions returning a ``Future`` will not block. They
 ## will not however return immediately. An asynchronous function will have
@@ -1611,4 +1612,4 @@ proc waitFor*[T](fut: Future[T]): T =
 
   fut.read
 
-{.deprecated: [setEvent: trigger].}
\ No newline at end of file
+{.deprecated: [setEvent: trigger].}
127'>127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172