@@ -101,7 +101,7 @@ class PULSAR_PUBLIC Client {
101101 * @param callback the callback that is triggered when the producer is created successfully or not
102102 * @param callback Callback function that is invoked when the operation is completed
103103 */
104- void createProducerAsync (const std::string& topic, CreateProducerCallback callback);
104+ void createProducerAsync (const std::string& topic, const CreateProducerCallback& callback);
105105
106106 /* *
107107 * Asynchronously create a producer with the customized ProducerConfiguration for publishing on a specific
@@ -110,8 +110,8 @@ class PULSAR_PUBLIC Client {
110110 * @param topic the name of the topic where to produce
111111 * @param conf the customized ProducerConfiguration
112112 */
113- void createProducerAsync (const std::string& topic, ProducerConfiguration conf,
114- CreateProducerCallback callback);
113+ void createProducerAsync (const std::string& topic, const ProducerConfiguration& conf,
114+ const CreateProducerCallback& callback);
115115
116116 /* *
117117 * Subscribe to a given topic and subscription combination with the default ConsumerConfiguration
@@ -144,7 +144,7 @@ class PULSAR_PUBLIC Client {
144144 * default ConsumerConfiguration are asynchronously subscribed successfully or not
145145 */
146146 void subscribeAsync (const std::string& topic, const std::string& subscriptionName,
147- SubscribeCallback callback);
147+ const SubscribeCallback& callback);
148148
149149 /* *
150150 * Asynchronously subscribe to a given topic and subscription combination with the customized
@@ -157,7 +157,7 @@ class PULSAR_PUBLIC Client {
157157 * customized ConsumerConfiguration are asynchronously subscribed successfully or not
158158 */
159159 void subscribeAsync (const std::string& topic, const std::string& subscriptionName,
160- const ConsumerConfiguration& conf, SubscribeCallback callback);
160+ const ConsumerConfiguration& conf, const SubscribeCallback& callback);
161161
162162 /* *
163163 * Subscribe to multiple topics under the same namespace.
@@ -191,7 +191,7 @@ class PULSAR_PUBLIC Client {
191191
192192 */
193193 void subscribeAsync (const std::vector<std::string>& topics, const std::string& subscriptionName,
194- SubscribeCallback callback);
194+ const SubscribeCallback& callback);
195195
196196 /* *
197197 * Asynchronously subscribe to a list of topics and subscription combination using the customized
@@ -204,7 +204,7 @@ class PULSAR_PUBLIC Client {
204204 * the customized ConsumerConfiguration are asynchronously subscribed successfully or not
205205 */
206206 void subscribeAsync (const std::vector<std::string>& topics, const std::string& subscriptionName,
207- const ConsumerConfiguration& conf, SubscribeCallback callback);
207+ const ConsumerConfiguration& conf, const SubscribeCallback& callback);
208208
209209 /* *
210210 * Subscribe to multiple topics, which match given regexPattern, under the same namespace.
@@ -227,7 +227,7 @@ class PULSAR_PUBLIC Client {
227227 * SubscribeCallback)
228228 */
229229 void subscribeWithRegexAsync (const std::string& regexPattern, const std::string& subscriptionName,
230- SubscribeCallback callback);
230+ const SubscribeCallback& callback);
231231
232232 /* *
233233 * Asynchronously subscribe to multiple topics (which match given regexPatterns) with the customized
@@ -240,7 +240,7 @@ class PULSAR_PUBLIC Client {
240240 * ConsumerConfiguration under the same namespace are asynchronously subscribed successfully or not
241241 */
242242 void subscribeWithRegexAsync (const std::string& regexPattern, const std::string& subscriptionName,
243- const ConsumerConfiguration& conf, SubscribeCallback callback);
243+ const ConsumerConfiguration& conf, const SubscribeCallback& callback);
244244
245245 /* *
246246 * Create a topic reader with given {@code ReaderConfiguration} for reading messages from the specified
@@ -301,7 +301,7 @@ class PULSAR_PUBLIC Client {
301301 * @return the Reader object
302302 */
303303 void createReaderAsync (const std::string& topic, const MessageId& startMessageId,
304- const ReaderConfiguration& conf, ReaderCallback callback);
304+ const ReaderConfiguration& conf, const ReaderCallback& callback);
305305
306306 /* *
307307 * Create a table view with given {@code TableViewConfiguration} for specified topic.
@@ -331,7 +331,7 @@ class PULSAR_PUBLIC Client {
331331 * built from a message that already exists
332332 */
333333 void createTableViewAsync (const std::string& topic, const TableViewConfiguration& conf,
334- TableViewCallback callBack);
334+ const TableViewCallback& callBack);
335335
336336 /* *
337337 * Get the list of partitions for a given topic.
@@ -363,7 +363,7 @@ class PULSAR_PUBLIC Client {
363363 * the callback that will be invoked when the list of partitions is available
364364 * @since 2.3.0
365365 */
366- void getPartitionsForTopicAsync (const std::string& topic, GetPartitionsCallback callback);
366+ void getPartitionsForTopicAsync (const std::string& topic, const GetPartitionsCallback& callback);
367367
368368 /* *
369369 *
@@ -380,7 +380,7 @@ class PULSAR_PUBLIC Client {
380380 * @param callback the callback that is triggered when the Pulsar client is asynchronously closed
381381 * successfully or not
382382 */
383- void closeAsync (CloseCallback callback);
383+ void closeAsync (const CloseCallback& callback);
384384
385385 /* *
386386 * Perform immediate shutdown of Pulsar client.
@@ -415,7 +415,7 @@ class PULSAR_PUBLIC Client {
415415 std::function<void (Result, const SchemaInfo&)> callback);
416416
417417 private:
418- Client (const std::shared_ptr<ClientImpl>);
418+ Client (const std::shared_ptr<ClientImpl>& );
419419
420420 friend class PulsarFriend ;
421421 friend class PulsarWrapper ;
0 commit comments