A SEDAStage must always take, as input, an object of the type specified as the first template argument. (Generally a server will define a "work unit" type that includes a reference to the client Socket.) If always generates a particular kind of output element, consider using the SEDAStage<In, Out> construction that lets the user of your component specify a particular "next" stage.
Public Methods | |
| SEDAStage (string name=string()) | |
| Constructor. | |
| virtual | ~SEDAStage () |
| Destructor. | |
| void | scan () |
| Periodic scan to see whether to kill a Thread. | |
| void | set_nthreads (unsigned int min, unsigned int max) |
| Sets the minimum and maximum number of threads (inclusive) which may be assigned to this stage. | |
| void | inject (In &in) |
| Injects an element into the queue. | |
| virtual void | handle (In &in)=0 |
| Called on some handler Thread for each input element. | |
| virtual void | clogged (In &in) |
| Called when someone tries to inject an element into the queue, but there are no handlers available to service it. | |
Protected Methods | |
| void | add_threads () |
Friends | |
| class | my_thread |
|
|||||||||
|
Destructor. Joins all active handler threads, so this will not complete until all handlers exit (this is necessary because the handler threads may invoke methods on this class). |
|
|||||||||
|
|
|
||||||||||
|
Called when someone tries to inject an element into the queue, but there are no handlers available to service it. This is invoked on the same Thread which calls inject (before inject returns) so it must return very quickly. |
|
||||||||||
|
Called on some handler Thread for each input element.
|
|
||||||||||
|
Injects an element into the queue.
|
|
|||||||||
|
Periodic scan to see whether to kill a Thread.
Implements seda_stage_base. |
|
||||||||||
|
Constructor.
|
|
||||||||||||||||
|
Sets the minimum and maximum number of threads (inclusive) which may be assigned to this stage.
Implements seda_stage_base. |
|
|||||
|
|