Apache Mesos
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
zookeeper::GroupProcess Class Reference

#include <group.hpp>

Inheritance diagram for zookeeper::GroupProcess:
process::Process< GroupProcess > process::ProcessBase process::EventConsumer

Public Member Functions

 GroupProcess (const std::string &servers, const Duration &sessionTimeout, const std::string &znode, const Option< Authentication > &auth)
 
 GroupProcess (const URL &url, const Duration &sessionTimeout)
 
 ~GroupProcess () override
 
void initialize () override
 Invoked when a process gets spawned. More...
 
process::Future< Group::Membershipjoin (const std::string &data, const Option< std::string > &label)
 
process::Future< bool > cancel (const Group::Membership &membership)
 
process::Future< Option< std::string > > data (const Group::Membership &membership)
 
process::Future< std::set< Group::Membership > > watch (const std::set< Group::Membership > &expected)
 
process::Future< Option< int64_t > > session ()
 
void connected (int64_t sessionId, bool reconnect)
 
void reconnecting (int64_t sessionId)
 
void expired (int64_t sessionId)
 
void updated (int64_t sessionId, const std::string &path)
 
void created (int64_t sessionId, const std::string &path)
 
void deleted (int64_t sessionId, const std::string &path)
 
- Public Member Functions inherited from process::Process< GroupProcess >
 ~Process () override
 
PID< GroupProcess > self () const
 Returns the PID of the process. More...
 
- Public Member Functions inherited from process::ProcessBase
 ProcessBase (const std::string &id="")
 
 ~ProcessBase () override
 
const UPIDself () const
 
- Public Member Functions inherited from process::EventConsumer
virtual ~EventConsumer ()
 

Static Public Member Functions

static std::string zkBasename (const Group::Membership &membership)
 

Static Public Attributes

static const Duration RETRY_INTERVAL
 

Additional Inherited Members

- Protected Types inherited from process::Process< GroupProcess >
typedef GroupProcess Self
 
typedef GroupProcess This
 
- Protected Types inherited from process::ProcessBase
enum  RemoteConnection { RemoteConnection::REUSE, RemoteConnection::RECONNECT }
 Describes the behavior of the link call when the target pid points to a remote process. More...
 
typedef lambda::function< void(const UPID &, const std::string &)> MessageHandler
 Any function which takes a "from" UPID and a message body as arguments. More...
 
typedef lambda::function< Future< http::Response >const http::Request &)> HttpRequestHandler
 Any function which takes a process::http::Request and returns a process::http::Response. More...
 
typedef lambda::function< Future< http::Response > const http::Request &, const Option< http::authentication::Principal > &)> AuthenticatedHttpRequestHandler
 Any function which takes a process::http::Request and an Option<Principal> and returns a process::http::Response. More...
 
- Protected Member Functions inherited from process::ProcessBase
virtual void serve (Event &&event)
 Invoked when an event is serviced. More...
 
void consume (MessageEvent &&event) override
 
void consume (DispatchEvent &&event) override
 
void consume (HttpEvent &&event) override
 
void consume (ExitedEvent &&event) override
 
void consume (TerminateEvent &&event) override
 
virtual void finalize ()
 Invoked when a process is terminated. More...
 
virtual void exited (const UPID &)
 Invoked when a linked process has exited. More...
 
virtual void lost (const UPID &)
 Invoked when a linked process can no longer be monitored. More...
 
void send (const UPID &to, const std::string &name, const char *data=nullptr, size_t length=0)
 Sends the message to the specified UPID. More...
 
void send (const UPID &to, std::string &&name)
 
void send (const UPID &to, std::string &&name, std::string &&data)
 
UPID link (const UPID &pid, const RemoteConnection remote=RemoteConnection::REUSE)
 Links with the specified UPID. More...
 
void install (const std::string &name, const MessageHandler &handler)
 Sets up a handler for messages with the specified name. More...
 
template<typename T >
void install (const std::string &name, void(T::*method)(const UPID &, const std::string &))
 Sets up a handler for messages with the specified name. More...
 
void delegate (const std::string &name, const UPID &pid)
 Delegates incoming messages, with the specified name, to the UPID. More...
 
void route (const std::string &name, const Option< std::string > &help, const HttpRequestHandler &handler, const RouteOptions &options=RouteOptions())
 Sets up a handler for HTTP requests with the specified name. More...
 
template<typename T >
void route (const std::string &name, const Option< std::string > &help, Future< http::Response >(T::*method)(const http::Request &), const RouteOptions &options=RouteOptions())
 Sets up a handler for HTTP requests with the specified name. More...
 
void route (const std::string &name, const std::string &realm, const Option< std::string > &help, const AuthenticatedHttpRequestHandler &handler, const RouteOptions &options=RouteOptions())
 
template<typename T >
void route (const std::string &name, const Option< std::string > &realm, const Option< std::string > &help, Future< http::Response >(T::*method)(const http::Request &, const Option< http::authentication::Principal > &), const RouteOptions &options=RouteOptions())
 Forwards to the correct overload of process::ProcessBase::route(), depending on whether the authentication realm realm is present. More...
 
void provide (const std::string &name, const std::string &path, const std::map< std::string, std::string > &types=mime::types)
 Sets up the default HTTP request handler to provide the static asset(s) at the specified absolute path for the specified name. More...
 
template<typename T >
size_t eventCount ()
 Returns the number of events of the given type currently on the event queue. More...
 

Constructor & Destructor Documentation

zookeeper::GroupProcess::GroupProcess ( const std::string &  servers,
const Duration sessionTimeout,
const std::string &  znode,
const Option< Authentication > &  auth 
)
zookeeper::GroupProcess::GroupProcess ( const URL url,
const Duration sessionTimeout 
)
zookeeper::GroupProcess::~GroupProcess ( )
override

Member Function Documentation

process::Future<bool> zookeeper::GroupProcess::cancel ( const Group::Membership membership)
void zookeeper::GroupProcess::connected ( int64_t  sessionId,
bool  reconnect 
)
void zookeeper::GroupProcess::created ( int64_t  sessionId,
const std::string &  path 
)
process::Future<Option<std::string> > zookeeper::GroupProcess::data ( const Group::Membership membership)
void zookeeper::GroupProcess::deleted ( int64_t  sessionId,
const std::string &  path 
)
void zookeeper::GroupProcess::expired ( int64_t  sessionId)
void zookeeper::GroupProcess::initialize ( )
overridevirtual

Invoked when a process gets spawned.

Reimplemented from process::ProcessBase.

process::Future<Group::Membership> zookeeper::GroupProcess::join ( const std::string &  data,
const Option< std::string > &  label 
)
void zookeeper::GroupProcess::reconnecting ( int64_t  sessionId)
process::Future<Option<int64_t> > zookeeper::GroupProcess::session ( )
void zookeeper::GroupProcess::updated ( int64_t  sessionId,
const std::string &  path 
)
process::Future<std::set<Group::Membership> > zookeeper::GroupProcess::watch ( const std::set< Group::Membership > &  expected)
static std::string zookeeper::GroupProcess::zkBasename ( const Group::Membership membership)
static

Member Data Documentation

std::queue<Cancel*> zookeeper::GroupProcess::cancels
std::queue<Data*> zookeeper::GroupProcess::datas
std::queue<Join*> zookeeper::GroupProcess::joins
const Duration zookeeper::GroupProcess::RETRY_INTERVAL
static
std::queue<Watch*> zookeeper::GroupProcess::watches

The documentation for this class was generated from the following file: