b_rabbit package¶
Submodules¶
b_rabbit.b_rabbit module¶
Main module.
-
class
b_rabbit.b_rabbit.
BRabbit
(host: str = 'localhost', port: int = 5672, user: str = None, password: str = None)[source]¶ Bases:
object
-
class
EventPublisher
(b_rabbit, publisher_name: str, exchange_type: str = 'topic', external: bool = False)[source]¶ Bases:
object
event publisher, which sends events to all subscribers. Internal and External Publishers are now together in one Implementation
-
publish
(routing_key: str, payload: str, important: bool = True, properties=None)[source]¶ Publish of internal event. All internal subscribers will receive it. Parameters: :param str routing_key: Routing key for event :param str payload: Payload of event :param str important: indicate whether the publishing important or not,
if yes it will set the mandatory publishing FeatureParameters: properties (BRabbit.Properties) – properties object containing the properties dictionary that will be loaded into the rabbitpy.message object.
-
-
class
EventSubscriber
(b_rabbit, routing_key: str, publisher_name: str, exchange_type: str = 'topic', routing_key_only: bool = False, external: bool = False, important_subscription: bool = True, event_listener: Callable = None, verbose: bool = False)[source]¶ Bases:
object
Subscribe to events send by publisher
-
class
TaskExecutor
(b_rabbit, executor_name: str, routing_key: str, task_listener)[source]¶ Bases:
object
-
channel
= None¶ TaskExecutor registers on Task which is triggered by TaskRequester.
-
corr_id
= None¶
-
-
class
TaskRequesterAsynchron
(b_rabbit, executor_name: str, routing_key: str, response_listener)[source]¶ Bases:
object
TaskRequesterSynchron requests tasks asynchon.
-
class
TaskRequesterSynchron
(b_rabbit, executor_name: str, routing_key: str, response_listener)[source]¶ Bases:
object
TaskRequesterSynchron requests tasks synchronously.
-
corr_id
= None¶
-
-
connection
= None¶
-
class
Module contents¶
Top-level package for b_rabbit.