Module
Node.WorkerBees.Aff
- Package
- purescript-node-workerbees
- Repository
- natefaubion/purescript-node-workerbees
#spawn Source
spawn :: forall a i o. Sendable a => Worker a i o -> a -> Aff (Tuple (WorkerThread i) (AVar (Either Int o)))
Instantiates a new worker thread. If this worker subscribes to input, it
will need to be cleaned up with terminate
, otherwise it will hold your
process open. Yields a WorkerThread instance, and an AVar which can be
polled for results. Polling the AVar may result in an exception, and
if the worker has just exited, will yield an exit code.