pulsar.messaging package

Submodules

pulsar.messaging.bind_amqp module

pulsar.messaging.bind_amqp.bind_manager_to_queue(manager, queue_state, connection_string, conf)[source]
pulsar.messaging.bind_amqp.get_exchange(connection_string, manager_name, conf)[source]
pulsar.messaging.bind_amqp.start_kill_consumer(exchange, target)
pulsar.messaging.bind_amqp.start_setup_consumer(exchange, target)
pulsar.messaging.bind_amqp.start_status_consumer(exchange, target)
pulsar.messaging.bind_amqp.start_status_update_ack_consumer(exchange, target)

pulsar.messaging.bind_relay module

Pulsar server-side integration with pulsar-relay.

This module provides functionality to bind Pulsar job managers to the pulsar-relay, allowing them to receive control messages (setup, status requests, kill) and publish status updates.

pulsar.messaging.bind_relay.bind_manager_to_relay(manager, relay_state: RelayState, relay_url, conf)[source]

Bind a specific manager to the relay.

Args:

manager: Pulsar job manager instance relay_state: RelayState for managing consumer threads relay_url: URL of the pulsar-relay server conf: Configuration dictionary with relay credentials

pulsar.messaging.bind_relay.start_consumer(relay_transport, relay_state: RelayState, topics, handlers)[source]

Start a consumer thread that polls for messages.

Args:

relay_transport: RelayTransport instance relay_state: RelayState for checking if consumer should continue topics: List of topics to subscribe to handlers: Dict mapping topics to handler functions

Returns:

Thread object

pulsar.messaging.relay_state module

State management for pulsar-relay message consumers.

Similar to QueueState for AMQP, this manages the lifecycle of relay consumer threads on the Pulsar server side.

class pulsar.messaging.relay_state.RelayState[source]

Bases: object

Manages state for pulsar-relay message consumers.

This object is passed to consumer loops and used to signal when they should stop processing messages.

deactivate() None[source]

Mark the relay state as inactive, signaling consumers to stop.

join(timeout: float | None = None) None[source]

Join all consumer threads.

Module contents

This module contains the server-side only code for interfacing with message queues. Code shared between client and server can be found in submodules of pulsar.client.

class pulsar.messaging.QueueState[source]

Bases: object

Passed through to event loops, should be “non-zero” while queues should be active.

deactivate()[source]
join(timeout=None)[source]
pulsar.messaging.bind_app(app, queue_id, conf=None)[source]