little fixes for 0.8.14 release

This commit is contained in:
Araq 2012-02-09 02:26:08 +01:00
commit b458dc7009
6 changed files with 134 additions and 77 deletions

View file

@ -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;