pipert.core.component¶
Module Contents¶
Classes¶
-
class
pipert.core.component.BaseComponent(component_config, start_component=False)[source]¶ -
-
_start(self)[source]¶ Goes over the component’s routines registered in self.routines and starts running them.
-
register_routine(self, routine: Union[Routine, Process, Thread])[source]¶ Registers routine to the list of component’s routines Args:
routine: the routine to register
-
_teardown_callback(self, *args, **kwargs)[source]¶ Implemented by subclasses of BaseComponent. Used for stopping or tearing down things that are not stopped by setting the stop_event. Returns: None
-
create_queue(self, queue_name, queue_size=1)[source]¶ Create a new queue for the component. Returns True if created or False otherwise Args:
queue_name: the name of the queue, must be unique queue_size: the size of the queue
-
get_queue(self, queue_name)[source]¶ Returns the queue object by its name Args:
queue_name: the name of the queue
- Raises:
KeyError - if no queue has the name
-
does_queue_exist(self, queue_name)[source]¶ Returns True the component has a queue named queue_name or False otherwise Args:
queue_name: the name of the queue to check
-