7 #ifndef ZEROEQ_SUBSCRIBER_H 8 #define ZEROEQ_SUBSCRIBER_H 10 #include <zeroeq/receiver.h> 58 ZEROEQ_API
explicit Subscriber(
const std::string& session );
89 ZEROEQ_API
Subscriber(
const URI& uri,
const std::string& session );
130 ZEROEQ_API
Subscriber(
const URI& uri,
const std::string& session,
149 ZEROEQ_API
bool subscribe( servus::Serializable& serializable );
171 ZEROEQ_API
bool subscribe(
const uint128_t& event,
181 ZEROEQ_API
bool unsubscribe(
const servus::Serializable& serializable );
183 ZEROEQ_API
bool unsubscribe(
const uint128_t& event );
186 ZEROEQ_API
const std::string&
getSession()
const;
190 std::unique_ptr< Impl > _impl;
193 void addSockets( std::vector< detail::Socket >& entries )
final;
194 void process( detail::Socket& socket, uint32_t timeout )
final;
196 void addConnection(
const std::string& uri )
final;
Enhances servus::URI to guarantee the existance of a schema and to allow construction of [host][:port...
Subscribes to Publisher to receive events.
bool unsubscribe(const servus::Serializable &serializable)
Unsubscribe a serializable object to stop applying updates from any connected publisher.
const std::string & getSession() const
Subscriber()
Create a default subscriber.
~Subscriber()
Destroy this subscriber and withdraw any subscriptions.
bool subscribe(servus::Serializable &serializable)
Subscribe a serializable object to receive updates from any connected publisher.
std::function< void() > EventFunc
Callback for receival of subscribed event w/o payload.
Base class for entities receiving data.
std::function< void(const void *, size_t) > EventPayloadFunc
Callback for receival of subscribed event w/ payload.
Publish-subscribe classes for typed events.