pulsar-client-cpp
Loading...
Searching...
No Matches
producer.h
1
20#pragma once
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#include <pulsar/c/message.h>
27#include <pulsar/c/result.h>
28#include <pulsar/defines.h>
29#include <stdint.h>
30
31typedef struct _pulsar_producer pulsar_producer_t;
32
33typedef void (*pulsar_send_callback)(pulsar_result, pulsar_message_id_t *msgId, void *ctx);
34typedef void (*pulsar_close_callback)(pulsar_result, void *ctx);
35typedef void (*pulsar_flush_callback)(pulsar_result, void *ctx);
36
40PULSAR_PUBLIC const char *pulsar_producer_get_topic(pulsar_producer_t *producer);
41
45PULSAR_PUBLIC const char *pulsar_producer_get_producer_name(pulsar_producer_t *producer);
46
63PULSAR_PUBLIC pulsar_result pulsar_producer_send(pulsar_producer_t *producer, pulsar_message_t *msg);
64
79PULSAR_PUBLIC void pulsar_producer_send_async(pulsar_producer_t *producer, pulsar_message_t *msg,
80 pulsar_send_callback callback, void *ctx);
81
94PULSAR_PUBLIC int64_t pulsar_producer_get_last_sequence_id(pulsar_producer_t *producer);
95
105PULSAR_PUBLIC pulsar_result pulsar_producer_close(pulsar_producer_t *producer);
106
114PULSAR_PUBLIC void pulsar_producer_close_async(pulsar_producer_t *producer, pulsar_close_callback callback,
115 void *ctx);
116
117// Flush all the messages buffered in the client and wait until all messages have been successfully persisted.
118PULSAR_PUBLIC pulsar_result pulsar_producer_flush(pulsar_producer_t *producer);
119
120PULSAR_PUBLIC void pulsar_producer_flush_async(pulsar_producer_t *producer, pulsar_flush_callback callback,
121 void *ctx);
122
123PULSAR_PUBLIC void pulsar_producer_free(pulsar_producer_t *producer);
124
125PULSAR_PUBLIC int pulsar_producer_is_connected(pulsar_producer_t *producer);
126
127#ifdef __cplusplus
128}
129#endif