summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-02-09 02:26:08 +0100
committerAraq <rumpf_a@web.de>2012-02-09 02:26:08 +0100
commitb458dc70096d3f23c72b28097ef4ce5329893db8 (patch)
tree707563df5ad0da87d6393455d408926653840a93 /lib
parent32b4192b3f0771af11e9d850046e5f3dd42a9a5f (diff)
downloadNim-b458dc70096d3f23c72b28097ef4ce5329893db8.tar.gz
little fixes for 0.8.14 release
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/actors.nim13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/pure/actors.nim b/lib/pure/actors.nim
index 6703470bd..121dabf82 100644
--- a/lib/pure/actors.nim
+++ b/lib/pure/actors.nim
@@ -10,11 +10,22 @@
 ## `Actor`:idx: support for Nimrod. An actor is implemented as a thread with
 ## a channel as its inbox. This module requires the ``--threads:on``
 ## command line switch.
+##
+## Example:
+##
+## .. code-block:: nimrod
+##
+##      var
+##        a: TActorPool[int, void]
+##      createActorPool(a)
+##      for i in 0 .. < 300:
+##        a.spawn(i, proc (x: int) {.thread.} = echo x)
+##      a.join()
 
 from os import sleep
 
 type
-  TTask*[TIn, TOut] = object{.pure, final.}
+  TTask*[TIn, TOut] = object{.pure, final.} ## a task
     when TOut isnot void:
       receiver*: ptr TChannel[TOut] ## the receiver channel of the response
     action*: proc (x: TIn): TOut {.thread.} ## action to execute;