slacm.component module
Created on Sep 19, 2020
@author: esdev
- class slacm.component.Component[source]
Bases:
objectBase class for all components.
- ERR = -1
- FINALIZE = 2
- OK = 0
- SETUP = 1
- START = 3
- STOP = 4
- class slacm.component.ComponentThread(parent)[source]
Bases:
ThreadComponent executor thread.
- executeHandlerFor(socket)[source]
Execute the handler for the port corresponding to the socket. The handler is always allowed to run to completion, the operation is never preempted.
- finalize()[source]
Execute the ‘finalize’ phase of component initialization. Finalize all ports, and connect the ‘client’ ports with the discovery service.
- scheduler(sockets)[source]
Priority scheduler for the component message processing.
The priority order is determined by the order of component ports. The dictionary of active sockets is scanned, and the they are inserted into a priority queue (according to their priority value). The queue is processed (in order of priority). After each invocation, the inputs are polled (in a no-wait operation) and the priority queue is updated.
- setup()[source]
Execute the ‘setup’ phase of component initialization. Construct all ports, and register the ‘server’ ports with the discovery service.