| Safe Haskell | None |
|---|
Control.Etage.Worker
Description
This module defines a worker Neuron which evaluates IO actions it receives. It is useful to offload lengthly IO actions
into another thread. In the case of too many queued IO actions they are silently dropped and only newest ones are evaluated.
You grow it in Incubation by using something like:
nerveWorker <- (growNeuron :: NerveOnlyFor WorkerNeuron) defaultOptions
It is an example of a Neuron which defines getNeuronMapCapability. It processes only the newest Impulses it receives, when
they get queued, so Impulses are dropped if load is too high.
- data WorkerNeuron
- type WorkerFromImpulse = NeuronFromImpulse WorkerNeuron
- data WorkerForImpulse = Work {}
- type WorkerOptions = NeuronOptions WorkerNeuron
- type WorkType = IO ()
Documentation
data WorkerNeuron Source
type WorkerFromImpulse = NeuronFromImpulse WorkerNeuronSource
Impulses from WorkerNeuron. This Neuron does not define any Impulses it would send, NoImpulse.
data WorkerForImpulse Source
Impulses for WorkerNeuron.
Constructors
| Work | |
Fields
| |
type WorkerOptions = NeuronOptions WorkerNeuronSource
Options for WorkerNeuron. This option is defined:
mapOnCapability ::NeuronMapCapability- How to map the
Neuronon capabilities (OS threads). With this option you can fix multipleNeurons on the same capability (for example, by generating one value withmkNeuronMapOnRandomCapabilityand using it for all thoseNeurons) which is sometimes necessary when dealing with external (FFI) libraries. Default value isNeuronFreelyMapOnCapability.