class documentation

class Producer: (source)

Constructor: Producer(producer)

View In Hierarchy

The Pulsar message producer, used to publish messages on a topic.

Method __init__ Create the producer. Users should not call this constructor directly. Instead, create the producer via Client.create_producer.
Async Method close Close the producer.
Async Method send Send a message asynchronously.
Instance Variable _producer Undocumented
def __init__(self, producer: _pulsar.Producer): (source)

Create the producer. Users should not call this constructor directly. Instead, create the producer via Client.create_producer.

Parameters
producer:_pulsar.ProducerThe underlying Producer object from the C extension.
async def close(self): (source)

Close the producer.

Raises
PulsarException
async def send(self, content: bytes) -> pulsar.MessageId: (source)

Send a message asynchronously.

Parameters
content:bytesThe message payload
Returns
pulsar.MessageIdThe message id that represents the persisted position of the message.
Raises
PulsarException

Undocumented