20#include "hazelcast/client/exception/iexception.h"
21#include "hazelcast/util/noop.h"
22#include "hazelcast/util/type_traits.h"
24#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
26#pragma warning(disable : 4251)
84 int64_t initial_sequence_id = -1);
96 template<
typename Handler,
97 typename = util::enable_if_rvalue_ref_trait<Handler&&>>
100 received_ = std::move(h);
107 template<
typename Handler,
108 typename = util::enable_if_rvalue_ref_trait<Handler&&>>
112 return std::move(*
this);
123 template<
typename Handler,
124 typename = util::enable_if_rvalue_ref_trait<Handler&&>>
127 store_sequence_id_ = std::move(h);
134 template<
typename Handler,
135 typename = util::enable_if_rvalue_ref_trait<Handler&&>>
139 return std::move(*
this);
150 template<
typename Handler,
151 typename = util::enable_if_rvalue_ref_trait<Handler&&>>
154 terminal_ = std::move(h);
161 template<
typename Handler,
162 typename = util::enable_if_rvalue_ref_trait<Handler&&>>
166 return std::move(*
this);
175 template<
typename Handler,
176 typename = util::enable_if_rvalue_ref_trait<Handler&&>>
179 on_cancel_ = std::move(h);
186 template<
typename Handler,
187 typename = util::enable_if_rvalue_ref_trait<Handler&&>>
191 return std::move(*
this);
195 using received_handler_t = std::function<void(
message&&)>;
196 using store_sequence_id_handler_t = std::function<void(int64_t)>;
197 using exception_handler_t =
199 using on_cancel_handler_t = std::function<void()>;
202 int64_t initial_sequence_id_;
204 received_handler_t received_{ util::noop<message&&> };
205 store_sequence_id_handler_t store_sequence_id_{ util::noop<int64_t> };
206 exception_handler_t terminal_{ [](
const exception::iexception&) {
209 on_cancel_handler_t on_cancel_{util::noop<>};
216#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
Base class for all exception originated from Hazelcast methods.
Hazelcast provides distribution mechanism for publishing messages that are delivered to multiple subs...
reliable_listener & terminate_on_exception(Handler &&h) &
Set an handler function that checks if the listener should be terminated based on an exception thrown...
reliable_listener && on_received(Handler &&h) &&
Set an handler function to be invoked when a message is received for the added topic.
reliable_listener & on_cancel(Handler &&h) &
Set an handler function which will be called when the listener is cancelled.
reliable_listener && terminate_on_exception(Handler &&h) &&
Set an handler function that checks if the listener should be terminated based on an exception thrown...
reliable_listener && on_cancel(Handler &&h) &&
Set an handler function which will be called when the listener is cancelled.
reliable_listener && on_store_sequence_id(Handler &&h) &&
reliable_listener(bool loss_tolerant, int64_t initial_sequence_id=-1)
reliable_listener & on_store_sequence_id(Handler &&h) &
Set an handler function to be invoked to informs the listener that it should store the sequence.
reliable_listener & on_received(Handler &&h) &
Set an handler function to be invoked when a message is received for the added topic.