<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/io/blob/v0.24.0/tensorflow_io/python/experimental/pulsar_writer_ops.py#L21-L48) |

PulsarWriter

    tfio.experimental.streaming.PulsarWriter(
        service_url, topic
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `service_url` | A [`tf.string`](https://www.tensorflow.org/api_docs/python/tf#string) tensor containing the service url of pulsar broker. For example: "pulsar://localhost:6650". |
| `topic` | A [`tf.string`](https://www.tensorflow.org/api_docs/python/tf#string) tensor containing the topic name. |

<br />

## Methods

### `flush`

[View source](https://github.com/tensorflow/io/blob/v0.24.0/tensorflow_io/python/experimental/pulsar_writer_ops.py#L46-L48)

    flush()

Flush the queued messages, it will wait async write operations completed.

### `write`

[View source](https://github.com/tensorflow/io/blob/v0.24.0/tensorflow_io/python/experimental/pulsar_writer_ops.py#L36-L44)

    write(
        value, key=''
    )

Write a message to pulsar topic asynchronously

<br />

<br />

<br />

| Args ||
|---|---|
| `value` | A [`tf.string`](https://www.tensorflow.org/api_docs/python/tf#string) tensor containing the value of message |
| `key` | A [`tf.string`](https://www.tensorflow.org/api_docs/python/tf#string) tensor containing the key of message, if it's an empty string, the message will have no key. Default: "" |

<br />