Generator
For each generator describe in the configuration file one instance is created and one thread is associate. When a new event must be generated, the generator call the event handler and the core service store the event in the queue associated with this generator.
Receiver
For each receiver in the configuration file one instance is created but you can choose 2 threading models. The first model is MonoThread, this model use one thread on each receiver for each event to treat. This model give a simple way to develop receiver because no concurency access is made on the same instance of the receiver. The second model is PoolThread, this model use a system pool of threads. Each time an event must be treated, a thread of the pool will be used. The pool is shared by all receivers of the service. This model add a constraint on the development of the receiver because two threads can run at the same time on the same instance of a receiver.
How to choose between the two models ?
- Your receiver take a lot of time by event or you have a lot of event : choose PoolThread
- Your receiver don't store private data or don't used shared ressource : you can choose either MonoThread or PoolThread
- You don't want to develop synchronization between shared ressource : choose MonoThread
Sample with MonoThread
Sample with PoolThread