bobocep.cep.engine.decider.decider.BoboDecider
- class bobocep.cep.engine.decider.decider.BoboDecider(phenomena: List[BoboPhenomenon], gen_event_id: BoboGenEventID, gen_run_id: BoboGenEventID, max_cache: int = 0, max_size: int = 0)[source]
Bases:
BoboEngineTask,BoboDeciderPublisher,BoboReceiverSubscriber,BoboDistributedSubscriberA decider task.
- __init__(phenomena: List[BoboPhenomenon], gen_event_id: BoboGenEventID, gen_run_id: BoboGenEventID, max_cache: int = 0, max_size: int = 0)[source]
- Parameters:
phenomena – List of phenomena.
gen_event_id – Event ID generator.
gen_run_id – Run ID generator.
max_cache – Max cache size (<=0 means no caching). Default: 0.
max_size – Max queue size. Default: 0 (unbounded).
- on_distributed_update(completed: List[BoboRunSerial], halted: List[BoboRunSerial], updated: List[BoboRunSerial]) None[source]
- Parameters:
completed – Completed runs.
halted – Halted runs.
updated – Updated runs.
- phenomena() Tuple[BoboPhenomenon, ...][source]
- Returns:
All phenomena under consideration by the decider.
- run_at(phenomenon_name: str, pattern_name: str, run_id: str) BoboRun | None[source]
- Parameters:
phenomenon_name – A phenomenon name.
pattern_name – A pattern name.
run_id – A run ID.
- Returns:
A run associated with the given phenomenon and pattern name; or None if no such run exists.
- runs_from(phenomenon_name: str, pattern_name: str) Tuple[BoboRun, ...][source]
- Parameters:
phenomenon_name – A phenomenon name.
pattern_name – A pattern name.
- Returns:
The runs associated with the given phenomenon and pattern name.
- snapshot() Tuple[List[BoboRunSerial], List[BoboRunSerial], List[BoboRunSerial]][source]
A snapshot of the current state of the Decider.
- Returns:
Tuple of cached completed, cached halted, and currently partially-completed runs. If caching is disabled, the first two lists will be empty.
- subscribe(subscriber: BoboDeciderSubscriber) None[source]
- Parameters:
subscriber – Subscriber to Decider data.