pulsar-client-cpp
Producer.h
1 
19 #ifndef PRODUCER_HPP_
20 #define PRODUCER_HPP_
21 
22 #include <pulsar/ProducerConfiguration.h>
23 #include <memory>
24 #include <stdint.h>
25 
26 #pragma GCC visibility push(default)
27 
28 namespace pulsar {
29 class ProducerImplBase;
30 class PulsarWrapper;
31 class PulsarFriend;
32 
33 typedef std::function<void(Result)> FlushCallback;
34 typedef std::shared_ptr<ProducerImplBase> ProducerImplBasePtr;
35 
36 class Producer {
37  public:
41  Producer();
42 
46  const std::string& getTopic() const;
47 
51  const std::string& getProducerName() const;
52 
69  Result send(const Message& msg);
70 
85  void sendAsync(const Message& msg, SendCallback callback);
86 
91  Result flush();
92 
97  void flushAsync(FlushCallback callback);
98 
111  int64_t getLastSequenceId() const;
112 
121  const std::string& getSchemaVersion() const;
122 
132  Result close();
133 
141  void closeAsync(CloseCallback callback);
142 
143  private:
144  explicit Producer(ProducerImplBasePtr);
145 
146  friend class ClientImpl;
147  friend class PulsarFriend;
148  friend class PulsarWrapper;
149 
150  ProducerImplBasePtr impl_;
151 };
152 } // namespace pulsar
153 
154 #pragma GCC visibility pop
155 
156 #endif /* PRODUCER_HPP_ */
pulsar::Producer::getLastSequenceId
int64_t getLastSequenceId() const
pulsar::Producer::flushAsync
void flushAsync(FlushCallback callback)
pulsar::Result
Result
Definition: Result.h:31
pulsar::Producer::Producer
Producer()
pulsar::Producer::close
Result close()
pulsar::Producer::sendAsync
void sendAsync(const Message &msg, SendCallback callback)
pulsar::Producer::send
Result send(const Message &msg)
pulsar::Producer::getProducerName
const std::string & getProducerName() const
pulsar::Message
Definition: Message.h:43
pulsar::Producer::getSchemaVersion
const std::string & getSchemaVersion() const
pulsar
Definition: Authentication.h:31
pulsar::Producer::getTopic
const std::string & getTopic() const
pulsar::Producer::closeAsync
void closeAsync(CloseCallback callback)
pulsar::Producer::flush
Result flush()
pulsar::Producer
Definition: Producer.h:36