little fixes for 0.8.14 release
This commit is contained in:
parent
32b4192b3f
commit
b458dc7009
6 changed files with 134 additions and 77 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue