Apache Mesos
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
process Namespace Reference

Namespaces

 firewall
 
 grpc
 
 http
 
 http_parsing
 
 ID
 
 inject
 
 internal
 
 io
 
 metrics
 
 mime
 
 network
 
 windows
 

Classes

struct  _Deferred
 
class  AsyncExecutor
 
class  Clock
 Provides timers. More...
 
class  ClockTestEventListener
 
struct  Continue
 
class  ControlFlow
 
class  CountDownLatch
 
class  DataDecoder
 
class  DataEncoder
 
struct  Deferred
 
struct  DispatchEvent
 
class  Encoder
 
struct  ErrnoFailure
 
struct  Event
 
struct  EventConsumer
 
class  EventLoop
 
class  EventQueue
 
struct  EventVisitor
 
class  Executor
 
struct  ExitedEvent
 
struct  Failure
 
class  FileEncoder
 
class  Filter
 
class  FilterTestEventListener
 
class  Future
 
class  Gate
 
class  Help
 
struct  HttpEvent
 
class  HttpProxy
 
class  HttpResponseEncoder
 
class  Latch
 
class  Logging
 
struct  LoopIndex
 
class  MemoryProfiler
 
struct  Message
 
class  MessageEncoder
 
struct  MessageEvent
 
class  MockFilter
 
class  MpscLinkedQueue
 
class  Mutex
 
class  Once
 
class  Owned
 
struct  PID
 A "process identifier" used to uniquely identify a process when dispatching messages. More...
 
class  Process
 
class  ProcessBase
 
class  ProcessReference
 
class  Profiler
 
class  Promise
 
class  Queue
 
class  RateLimiter
 
class  RateLimiterProcess
 
class  ReadWriteLock
 ReadWriteLock is a lock that allows concurrent reads and exclusive writes. More...
 
class  ResponseDecoder
 
class  RFC1123
 
class  RFC3339
 
class  RunQueue
 
class  Sequence
 
class  SequenceProcess
 
class  Shared
 
class  SocketManager
 
class  StateMachine
 
struct  Statistics
 
class  StreamingRequestDecoder
 
class  StreamingResponseDecoder
 
class  Subprocess
 Represents a fork() exec()ed subprocess. More...
 
class  System
 
struct  TerminateEvent
 
class  TestsFilter
 
class  Time
 
class  Timeout
 
class  Timer
 
struct  TimeSeries
 
struct  UndiscardableDecorator
 
struct  UPID
 An "untyped" PID, used to encapsulate the process ID for lower-layer abstractions (eg, when receiving incoming requests) in the dispatching mechanism. More...
 
class  WeakFuture
 

Typedefs

using InputFileDescriptors = Subprocess::IO::InputFileDescriptors
 
using OutputFileDescriptors = Subprocess::IO::OutputFileDescriptors
 

Enumerations

enum  EventLoopLogicFlow { ALLOW_SHORT_CIRCUIT, DISALLOW_SHORT_CIRCUIT }
 

Functions

Future< Nothingafter (const Duration &duration)
 
template<typename F >
Future< typename result_of< F()>::type > async (const F &f, typename std::enable_if<!std::is_void< typename result_of< F()>::type >::value >::type *=nullptr)
 
template<typename F >
Future< Nothingasync (const F &f, typename std::enable_if< std::is_void< typename result_of< F()>::type >::value >::type *=nullptr)
 
 REPEAT_FROM_TO (1, 13, TEMPLATE, _) class AsyncExecutorProcess
 
template<typename T >
Future< std::vector< T > > collect (const std::vector< Future< T >> &futures)
 
template<typename... Ts>
Future< std::tuple< Ts... > > collect (const Future< Ts > &...futures)
 
template<typename T >
Future< std::vector< Future< T > > > await (const std::vector< Future< T >> &futures)
 
template<typename... Ts>
Future< std::tuple< Future< Ts >... > > await (const Future< Ts > &...futures)
 
template<typename T >
Future< Future< T > > await (const Future< T > &future)
 
template<typename T >
Deferred< void()> defer (const PID< T > &pid, void(T::*method)())
 
template<typename T >
Deferred< void()> defer (const Process< T > &process, void(T::*method)())
 
template<typename T >
Deferred< void()> defer (const Process< T > *process, void(T::*method)())
 
T Deferred< Future< R >)> defer (const PID< T > &pid, Future< R >(T::*method)())
 
template<typename R , typename T >
Deferred< Future< R >)> defer (const Process< T > &process, Future< R >(T::*method)())
 
template<typename R , typename T >
Deferred< Future< R >)> defer (const Process< T > *process, Future< R >(T::*method)())
 
T Deferred< Future< R >)> defer (const PID< T > &pid, R(T::*method)())
 
template<typename R , typename T >
Deferred< Future< R >)> defer (const Process< T > &process, R(T::*method)())
 
template<typename R , typename T >
Deferred< Future< R >)> defer (const Process< T > *process, R(T::*method)())
 
template<typename F >
_Deferred< F > defer (F &&f)
 
template<typename T >
Timer delay (const Duration &duration, const PID< T > &pid, void(T::*method)())
 
template<typename T >
Timer delay (const Duration &duration, const Process< T > &process, void(T::*method)())
 
template<typename T >
Timer delay (const Duration &duration, const Process< T > *process, void(T::*method)())
 
template<typename T >
void dispatch (const PID< T > &pid, void(T::*method)())
 
template<typename T >
void dispatch (const Process< T > &process, void(T::*method)())
 
template<typename T >
void dispatch (const Process< T > *process, void(T::*method)())
 
T Future< R > dispatch (const PID< T > &pid, Future< R >(T::*method)())
 
template<typename R , typename T >
Future< R > dispatch (const Process< T > &process, Future< R >(T::*method)())
 
template<typename R , typename T >
Future< R > dispatch (const Process< T > *process, Future< R >(T::*method)())
 
T Future< R > dispatch (const PID< T > &pid, R(T::*method)())
 
template<typename R , typename T >
Future< R > dispatch (const Process< T > &process, R(T::*method)())
 
template<typename R , typename T >
Future< R > dispatch (const Process< T > *process, R(T::*method)())
 
void filter (Filter *filter)
 
template<typename T >
Future< Future< T > > select (const std::set< Future< T >> &futures)
 
template<typename Futures >
void discard (const Futures &futures)
 
template<typename T >
std::ostream & operator<< (std::ostream &stream, const Future< T > &future)
 
template<typename T >
void setPromises (std::set< Promise< T > * > *promises, const T &t)
 
template<typename T >
void failPromises (std::set< Promise< T > * > *promises, const std::string &failure)
 
template<typename T >
void discardPromises (std::set< Promise< T > * > *promises)
 
template<typename T >
void discardPromises (std::set< Promise< T > * > *promises, const Future< T > &future)
 
template<typename T >
Future< T > undiscardable (const Future< T > &future)
 
template<typename F , typename std::enable_if< !is_specialization_of< typename std::decay< F >::type, Future >::value, int >::type = 0>
UndiscardableDecorator< typename std::decay< F >::type > undiscardable (F &&f)
 
 MATCHER_P2 (MessageMatcher, name, from,"")
 
 MATCHER_P3 (UnionMessageMatcher, message, unionType, from,"")
 
 MATCHER_P (DispatchMatcher, method,"")
 
 MATCHER_P (ExitedMatcher, from,"")
 
 MATCHER_P3 (HttpMatcher, message, path, deserializer,"")
 
 MATCHER_P4 (UnionHttpMatcher, message, unionType, path, deserializer,"")
 
template<typename Message , typename Path , typename Deserializer >
Future< http::RequestFutureHttpRequest (Message message, Path path, Deserializer deserializer, bool drop=false)
 
template<typename Message , typename UnionType , typename Path , typename Deserializer >
Future< http::RequestFutureUnionHttpRequest (Message message, UnionType unionType, Path path, Deserializer deserializer, bool drop=false)
 
template<typename Name , typename From , typename To >
Future< MessageFutureMessage (Name name, From from, To to, bool drop=false)
 
template<typename Message , typename UnionType , typename From , typename To >
Future< process::MessageFutureUnionMessage (Message message, UnionType unionType, From from, To to, bool drop=false)
 
template<typename PID , typename Method >
Future< NothingFutureDispatch (PID pid, Method method, bool drop=false)
 
template<typename Name , typename From , typename To >
void DropMessages (Name name, From from, To to)
 
template<typename Message , typename UnionType , typename From , typename To >
void DropUnionMessages (Message message, UnionType unionType, From from, To to)
 
template<typename Message , typename Path , typename Deserializer >
void DropHttpRequests (Message message, Path path, Deserializer deserializer, bool drop=false)
 
template<typename Message , typename UnionType , typename Path , typename Deserializer >
void DropUnionHttpRequests (Message message, UnionType unionType, Path path, Deserializer deserializer, bool drop=false)
 
template<typename Message , typename Path , typename Deserializer >
void ExpectNoFutureHttpRequests (Message message, Path path, Deserializer deserializer, bool drop=false)
 
template<typename Message , typename UnionType , typename Path , typename Deserializer >
void ExpectNoFutureUnionHttpRequests (Message message, UnionType unionType, Path path, Deserializer deserializer, bool drop=false)
 
template<typename Name , typename From , typename To >
void ExpectNoFutureMessages (Name name, From from, To to)
 
template<typename Message , typename UnionType , typename From , typename To >
void ExpectNoFutureUnionMessages (Message message, UnionType unionType, From from, To to)
 
template<typename PID , typename Method >
void DropDispatches (PID pid, Method method)
 
template<typename PID , typename Method >
void ExpectNoFutureDispatches (PID pid, Method method)
 
template<typename From , typename To >
Future< NothingFutureExited (From from, To to, bool drop=false)
 
std::string HELP (const std::string &tldr, const Option< std::string > &description=None(), const Option< std::string > &authentication=None(), const Option< std::string > &authorization=None(), const Option< std::string > &references=None())
 
std::string USAGE (const std::string &usage)
 
std::string TLDR (const std::string &tldr)
 
template<typename... T>
std::string DESCRIPTION (T &&...args)
 
std::string AUTHENTICATION (bool required)
 
template<typename... T>
std::string AUTHORIZATION (T &&...args)
 
template<typename... T>
std::string REFERENCES (T &&...args)
 
template<typename Iterate , typename Body , typename T = typename internal::unwrap<typename result_of<Iterate()>::type>::type, typename CF = typename internal::unwrap<typename result_of<Body(T)>::type>::type, typename V = typename CF::ValueType>
Future< V > loop (const Option< UPID > &pid, Iterate &&iterate, Body &&body)
 
template<typename Iterate , typename Body , typename T = typename internal::unwrap<typename result_of<Iterate()>::type>::type, typename CF = typename internal::unwrap<typename result_of<Body(T)>::type>::type, typename V = typename CF::ValueType>
Future< V > loop (Iterate &&iterate, Body &&body)
 
template<typename T >
ControlFlow< typename std::decay< T >::type >::Break Break (T &&t)
 
ControlFlow< Nothing >::Break Break ()
 
std::ostream & operator<< (std::ostream &stream, const UPID::ID &id)
 
bool operator== (const std::string &s, const UPID::ID &id)
 
bool operator!= (const std::string &s, const UPID::ID &id)
 
std::string operator+ (const UPID::ID &id, const std::string &s)
 
std::string operator+ (const UPID::ID &id, std::string &&s)
 
std::string operator+ (const std::string &s, const UPID::ID &id)
 
std::string operator+ (std::string &&s, const UPID::ID &id)
 
std::ostream & operator<< (std::ostream &, const UPID &)
 
std::istream & operator>> (std::istream &, UPID &)
 
bool initialize (const Option< std::string > &delegate=None(), const Option< std::string > &readwriteAuthenticationRealm=None(), const Option< std::string > &readonlyAuthenticationRealm=None())
 Initialize the library. More...
 
void finalize (bool finalize_wsa=false)
 Clean up the library. More...
 
std::string absolutePath (const std::string &path)
 Get the request absolutePath path with delegate prefix. More...
 
network::inet::Address address ()
 Returns the socket address associated with this instance of the library. More...
 
PID< Logginglogging ()
 Return the PID associated with the global logging process. More...
 
long workers ()
 Returns the number of worker threads the library has created. More...
 
UPID spawn (ProcessBase *process, bool manage=false)
 Spawn a new process. More...
 
UPID spawn (ProcessBase &process, bool manage=false)
 
template<typename T >
PID< T > spawn (T *t, bool manage=false)
 
template<typename T >
PID< T > spawn (T &t, bool manage=false)
 
void terminate (const UPID &pid, bool inject=true)
 Sends a TerminateEvent to the given process. More...
 
void terminate (const ProcessBase &process, bool inject)
 Sends a TerminateEvent to the given process. More...
 
void terminate (const ProcessBase *process, bool inject)
 Sends a TerminateEvent to the given process. More...
 
bool wait (const UPID &pid, const Duration &duration=Seconds(-1))
 Wait for the process to exit for no more than the specified seconds. More...
 
bool wait (const ProcessBase &process, const Duration &duration)
 Wait for the process to exit for no more than the specified seconds. More...
 
bool wait (const ProcessBase *process, const Duration &duration)
 Wait for the process to exit for no more than the specified seconds. More...
 
void post (const UPID &to, const std::string &name, const char *data=nullptr, size_t length=0)
 Sends a message with data without a return address. More...
 
void post (const UPID &from, const UPID &to, const std::string &name, const char *data=nullptr, size_t length=0)
 
void post (const process::UPID &to, const google::protobuf::Message &message)
 
void post (const process::UPID &from, const process::UPID &to, const google::protobuf::Message &message)
 
Duration MAX_REAP_INTERVAL ()
 
Future< Option< int > > reap (pid_t pid)
 
template<typename R >
Future< R > run (R(*method)())
 
Try< Subprocesssubprocess (const std::string &path, std::vector< std::string > argv, const Subprocess::IO &in=Subprocess::FD(STDIN_FILENO), const Subprocess::IO &out=Subprocess::FD(STDOUT_FILENO), const Subprocess::IO &err=Subprocess::FD(STDERR_FILENO), const flags::FlagsBase *flags=nullptr, const Option< std::map< std::string, std::string >> &environment=None(), const Option< lambda::function< pid_t(const lambda::function< int()> &)>> &clone=None(), const std::vector< Subprocess::ParentHook > &parent_hooks={}, const std::vector< Subprocess::ChildHook > &child_hooks={}, const std::vector< int_fd > &whitelist_fds={})
 Forks a subprocess and execs the specified 'path' with the specified 'argv', redirecting stdin, stdout, and stderr as specified by 'in', 'out', and 'err' respectively. More...
 
Try< Subprocesssubprocess (const std::string &command, const Subprocess::IO &in=Subprocess::FD(STDIN_FILENO), const Subprocess::IO &out=Subprocess::FD(STDOUT_FILENO), const Subprocess::IO &err=Subprocess::FD(STDERR_FILENO), const Option< std::map< std::string, std::string >> &environment=None(), const Option< lambda::function< pid_t(const lambda::function< int()> &)>> &clone=None(), const std::vector< Subprocess::ParentHook > &parent_hooks={}, const std::vector< Subprocess::ChildHook > &child_hooks={}, const std::vector< int_fd > &whitelist_fds={})
 Overload of 'subprocess' for launching a shell command, i.e., 'sh -c command'. More...
 
std::ostream & operator<< (std::ostream &stream, const RFC1123 &formatter)
 
std::ostream & operator<< (std::ostream &stream, const RFC3339 &formatter)
 
std::ostream & operator<< (std::ostream &stream, const Time &time)
 
LoopIndex get_loop (int_fd fd)
 
template<typename T >
void _run_in_event_loop (struct ev_loop *loop, const lambda::function< Future< T >(struct ev_loop *)> &f, const Owned< Promise< T >> &promise)
 
template<typename T >
Future< T > run_in_event_loop (const LoopIndex loop_index, const lambda::function< Future< T >(struct ev_loop *)> &f)
 
void run_in_event_loop (const lambda::function< void()> &f, EventLoopLogicFlow event_loop_logic_flow=ALLOW_SHORT_CIRCUIT)
 

Variables

F && f
 
thread_local Executor_executor_
 
constexpr char READONLY_HTTP_AUTHENTICATION_REALM [] = "libprocess-readonly"
 
constexpr char READWRITE_HTTP_AUTHENTICATION_REALM [] = "libprocess-readwrite"
 
Duration TEST_AWAIT_TIMEOUT
 
thread_local ProcessBase__process__
 
constexpr Duration TIME_SERIES_WINDOW = Weeks(2)
 
constexpr size_t TIME_SERIES_CAPACITY = 1000
 
const uint32_t GZIP_MINIMUM_BODY_LENGTH = 1024
 
struct ev_loop ** loops
 
ev_async * async_watchers
 
std::mutex * functions_mutexes
 
std::queue< lambda::function< void()> > * functions
 
thread_local struct ev_loop * _in_event_loop_
 
event_base * base
 
SocketManagersocket_manager
 
windows::EventLooplibwinio_loop
 

Typedef Documentation

Enumeration Type Documentation

Enumerator
ALLOW_SHORT_CIRCUIT 
DISALLOW_SHORT_CIRCUIT 

Function Documentation

template<typename T >
void process::_run_in_event_loop ( struct ev_loop *  loop,
const lambda::function< Future< T >(struct ev_loop *)> &  f,
const Owned< Promise< T >> &  promise 
)
std::string process::absolutePath ( const std::string &  path)

Get the request absolutePath path with delegate prefix.

network::inet::Address process::address ( )

Returns the socket address associated with this instance of the library.

Future<Nothing> process::after ( const Duration duration)
inline
template<typename F >
Future< typename result_of< F()>::type > process::async ( const F &  f,
typename std::enable_if<!std::is_void< typename result_of< F()>::type >::value >::type *  = nullptr 
)
template<typename F >
Future< Nothing > process::async ( const F &  f,
typename std::enable_if< std::is_void< typename result_of< F()>::type >::value >::type *  = nullptr 
)
std::string process::AUTHENTICATION ( bool  required)
inline
template<typename... T>
std::string process::AUTHORIZATION ( T &&...  args)
inline
template<typename T >
Future< std::vector< Future< T > > > process::await ( const std::vector< Future< T >> &  futures)
inline
template<typename... Ts>
Future< std::tuple< Future< Ts >... > > process::await ( const Future< Ts > &...  futures)
template<typename T >
Future<Future<T> > process::await ( const Future< T > &  future)
template<typename T >
ControlFlow<typename std::decay<T>::type>::Break process::Break ( T &&  t)
ControlFlow<Nothing>::Break process::Break ( )
inline
template<typename T >
Future< std::vector< T > > process::collect ( const std::vector< Future< T >> &  futures)
inline
template<typename... Ts>
Future< std::tuple< Ts... > > process::collect ( const Future< Ts > &...  futures)
template<typename T >
Deferred<void()> process::defer ( const PID< T > &  pid,
void(T::*)()  method 
)
template<typename T >
Deferred<void()> process::defer ( const Process< T > &  process,
void(T::*)()  method 
)
template<typename T >
Deferred<void()> process::defer ( const Process< T > *  process,
void(T::*)()  method 
)
T Deferred<Future<R>)> process::defer ( const PID< T > &  pid,
Future< R >(T::*)()  method 
)
template<typename R , typename T >
Deferred<Future<R>)> process::defer ( const Process< T > &  process,
Future< R >(T::*)()  method 
)
template<typename R , typename T >
Deferred<Future<R>)> process::defer ( const Process< T > *  process,
Future< R >(T::*)()  method 
)
T Deferred<Future<R>)> process::defer ( const PID< T > &  pid,
R(T::*)()  method 
)
template<typename R , typename T >
Deferred<Future<R>)> process::defer ( const Process< T > &  process,
R(T::*)()  method 
)
template<typename R , typename T >
Deferred<Future<R>)> process::defer ( const Process< T > *  process,
R(T::*)()  method 
)
template<typename F >
_Deferred<F> process::defer ( F &&  f)
template<typename T >
Timer process::delay ( const Duration duration,
const PID< T > &  pid,
void(T::*)()  method 
)
template<typename T >
Timer process::delay ( const Duration duration,
const Process< T > &  process,
void(T::*)()  method 
)
template<typename T >
Timer process::delay ( const Duration duration,
const Process< T > *  process,
void(T::*)()  method 
)
template<typename... T>
std::string process::DESCRIPTION ( T &&...  args)
inline
template<typename Futures >
void process::discard ( const Futures &  futures)
template<typename T >
void process::discardPromises ( std::set< Promise< T > * > *  promises)
template<typename T >
void process::discardPromises ( std::set< Promise< T > * > *  promises,
const Future< T > &  future 
)
template<typename T >
void process::dispatch ( const PID< T > &  pid,
void(T::*)()  method 
)
template<typename T >
void process::dispatch ( const Process< T > &  process,
void(T::*)()  method 
)
template<typename T >
void process::dispatch ( const Process< T > *  process,
void(T::*)()  method 
)
T Future<R> process::dispatch ( const PID< T > &  pid,
Future< R >(T::*)()  method 
)
template<typename R , typename T >
Future<R> process::dispatch ( const Process< T > &  process,
Future< R >(T::*)()  method 
)
template<typename R , typename T >
Future<R> process::dispatch ( const Process< T > *  process,
Future< R >(T::*)()  method 
)
T Future<R> process::dispatch ( const PID< T > &  pid,
R(T::*)()  method 
)
template<typename R , typename T >
Future<R> process::dispatch ( const Process< T > &  process,
R(T::*)()  method 
)
template<typename R , typename T >
Future<R> process::dispatch ( const Process< T > *  process,
R(T::*)()  method 
)
template<typename PID , typename Method >
void process::DropDispatches ( PID  pid,
Method  method 
)
template<typename Message , typename Path , typename Deserializer >
void process::DropHttpRequests ( Message  message,
Path  path,
Deserializer  deserializer,
bool  drop = false 
)
template<typename Name , typename From , typename To >
void process::DropMessages ( Name  name,
From  from,
To  to 
)
template<typename Message , typename UnionType , typename Path , typename Deserializer >
void process::DropUnionHttpRequests ( Message  message,
UnionType  unionType,
Path  path,
Deserializer  deserializer,
bool  drop = false 
)
template<typename Message , typename UnionType , typename From , typename To >
void process::DropUnionMessages ( Message  message,
UnionType  unionType,
From  from,
To  to 
)
template<typename PID , typename Method >
void process::ExpectNoFutureDispatches ( PID  pid,
Method  method 
)
template<typename Message , typename Path , typename Deserializer >
void process::ExpectNoFutureHttpRequests ( Message  message,
Path  path,
Deserializer  deserializer,
bool  drop = false 
)
template<typename Name , typename From , typename To >
void process::ExpectNoFutureMessages ( Name  name,
From  from,
To  to 
)
template<typename Message , typename UnionType , typename Path , typename Deserializer >
void process::ExpectNoFutureUnionHttpRequests ( Message  message,
UnionType  unionType,
Path  path,
Deserializer  deserializer,
bool  drop = false 
)
template<typename Message , typename UnionType , typename From , typename To >
void process::ExpectNoFutureUnionMessages ( Message  message,
UnionType  unionType,
From  from,
To  to 
)
template<typename T >
void process::failPromises ( std::set< Promise< T > * > *  promises,
const std::string &  failure 
)
void process::filter ( Filter filter)
void process::finalize ( bool  finalize_wsa = false)

Clean up the library.

Parameters
finalize_wsaWhether the Windows socket stack should be cleaned up for the entire process. Has no effect outside of Windows.
template<typename PID , typename Method >
Future<Nothing> process::FutureDispatch ( PID  pid,
Method  method,
bool  drop = false 
)
template<typename From , typename To >
Future<Nothing> process::FutureExited ( From  from,
To  to,
bool  drop = false 
)
template<typename Message , typename Path , typename Deserializer >
Future<http::Request> process::FutureHttpRequest ( Message  message,
Path  path,
Deserializer  deserializer,
bool  drop = false 
)
template<typename Name , typename From , typename To >
Future<Message> process::FutureMessage ( Name  name,
From  from,
To  to,
bool  drop = false 
)
template<typename Message , typename UnionType , typename Path , typename Deserializer >
Future<http::Request> process::FutureUnionHttpRequest ( Message  message,
UnionType  unionType,
Path  path,
Deserializer  deserializer,
bool  drop = false 
)
template<typename Message , typename UnionType , typename From , typename To >
Future<process::Message> process::FutureUnionMessage ( Message  message,
UnionType  unionType,
From  from,
To  to,
bool  drop = false 
)
LoopIndex process::get_loop ( int_fd  fd)
std::string process::HELP ( const std::string &  tldr,
const Option< std::string > &  description = None(),
const Option< std::string > &  authentication = None(),
const Option< std::string > &  authorization = None(),
const Option< std::string > &  references = None() 
)
bool process::initialize ( const Option< std::string > &  delegate = None(),
const Option< std::string > &  readwriteAuthenticationRealm = None(),
const Option< std::string > &  readonlyAuthenticationRealm = None() 
)

Initialize the library.

NOTE: libprocess uses Google's glog and you can specify options for it (e.g., a logging directory) via environment variables.

Parameters
delegateProcess to receive root HTTP requests.
readwriteAuthenticationRealmThe authentication realm that read-write libprocess-level HTTP endpoints will be installed under, if any. If this realm is not specified, read-write endpoints will be installed without authentication.
readonlyAuthenticationRealmThe authentication realm that read-only libprocess-level HTTP endpoints will be installed under, if any. If this realm is not specified, read-only endpoints will be installed without authentication.
Returns
true if this was the first invocation of process::initialize(), or false if it was not the first invocation.
See also
glog
PID<Logging> process::logging ( )

Return the PID associated with the global logging process.

template<typename Iterate , typename Body , typename T = typename internal::unwrap<typename result_of<Iterate()>::type>::type, typename CF = typename internal::unwrap<typename result_of<Body(T)>::type>::type, typename V = typename CF::ValueType>
Future< V > process::loop ( const Option< UPID > &  pid,
Iterate &&  iterate,
Body &&  body 
)
template<typename Iterate , typename Body , typename T = typename internal::unwrap<typename result_of<Iterate()>::type>::type, typename CF = typename internal::unwrap<typename result_of<Body(T)>::type>::type, typename V = typename CF::ValueType>
Future<V> process::loop ( Iterate &&  iterate,
Body &&  body 
)
process::MATCHER_P ( DispatchMatcher  ,
method  ,
""   
)
process::MATCHER_P ( ExitedMatcher  ,
from  ,
""   
)
process::MATCHER_P2 ( MessageMatcher  ,
name  ,
from  ,
""   
)
process::MATCHER_P3 ( UnionMessageMatcher  ,
message  ,
unionType  ,
from  ,
""   
)
process::MATCHER_P3 ( HttpMatcher  ,
message  ,
path  ,
deserializer  ,
""   
)
process::MATCHER_P4 ( UnionHttpMatcher  ,
message  ,
unionType  ,
path  ,
deserializer  ,
""   
)
Duration process::MAX_REAP_INTERVAL ( )
bool process::operator!= ( const std::string &  s,
const UPID::ID id 
)
inline
std::string process::operator+ ( const UPID::ID id,
const std::string &  s 
)
inline
std::string process::operator+ ( const UPID::ID id,
std::string &&  s 
)
inline
std::string process::operator+ ( const std::string &  s,
const UPID::ID id 
)
inline
std::string process::operator+ ( std::string &&  s,
const UPID::ID id 
)
inline
std::ostream& process::operator<< ( std::ostream &  stream,
const RFC1123 formatter 
)
std::ostream& process::operator<< ( std::ostream &  stream,
const RFC3339 formatter 
)
std::ostream& process::operator<< ( std::ostream &  stream,
const Time time 
)
inline
std::ostream& process::operator<< ( std::ostream &  stream,
const UPID::ID id 
)
inline
std::ostream& process::operator<< ( std::ostream &  ,
const UPID  
)
template<typename T >
std::ostream& process::operator<< ( std::ostream &  stream,
const Future< T > &  future 
)
bool process::operator== ( const std::string &  s,
const UPID::ID id 
)
inline
std::istream& process::operator>> ( std::istream &  ,
UPID  
)
void process::post ( const process::UPID to,
const google::protobuf::Message &  message 
)
inline
void process::post ( const process::UPID from,
const process::UPID to,
const google::protobuf::Message &  message 
)
inline
void process::post ( const UPID to,
const std::string &  name,
const char *  data = nullptr,
size_t  length = 0 
)

Sends a message with data without a return address.

Parameters
toReceiver of the message.
nameName of the message.
dataData to send (gets copied).
lengthLength of data.
void process::post ( const UPID from,
const UPID to,
const std::string &  name,
const char *  data = nullptr,
size_t  length = 0 
)
Future<Option<int> > process::reap ( pid_t  pid)
template<typename... T>
std::string process::REFERENCES ( T &&...  args)
inline
process::REPEAT_FROM_TO ( ,
13  ,
TEMPLATE  ,
 
)
template<typename R >
Future<R> process::run ( R(*)()  method)
void process::run_in_event_loop ( const lambda::function< void()> &  f,
EventLoopLogicFlow  event_loop_logic_flow = ALLOW_SHORT_CIRCUIT 
)
template<typename T >
Future<T> process::run_in_event_loop ( const LoopIndex  loop_index,
const lambda::function< Future< T >(struct ev_loop *)> &  f 
)
template<typename T >
Future<Future<T> > process::select ( const std::set< Future< T >> &  futures)
template<typename T >
void process::setPromises ( std::set< Promise< T > * > *  promises,
const T &  t 
)
UPID process::spawn ( ProcessBase process,
bool  manage = false 
)

Spawn a new process.

Parameters
processProcess to be spawned.
manageWhether process should get deleted by the runtime after terminating.
UPID process::spawn ( ProcessBase process,
bool  manage = false 
)
inline
template<typename T >
PID<T> process::spawn ( T *  t,
bool  manage = false 
)
template<typename T >
PID<T> process::spawn ( T &  t,
bool  manage = false 
)
Try<Subprocess> process::subprocess ( const std::string &  path,
std::vector< std::string >  argv,
const Subprocess::IO in = Subprocess::FD(STDIN_FILENO),
const Subprocess::IO out = Subprocess::FD(STDOUT_FILENO),
const Subprocess::IO err = Subprocess::FD(STDERR_FILENO),
const flags::FlagsBase flags = nullptr,
const Option< std::map< std::string, std::string >> &  environment = None(),
const Option< lambda::function< pid_t(const lambda::function< int()> &)>> &  clone = None(),
const std::vector< Subprocess::ParentHook > &  parent_hooks = {},
const std::vector< Subprocess::ChildHook > &  child_hooks = {},
const std::vector< int_fd > &  whitelist_fds = {} 
)

Forks a subprocess and execs the specified 'path' with the specified 'argv', redirecting stdin, stdout, and stderr as specified by 'in', 'out', and 'err' respectively.

Parameters
pathRelative or absolute path in the filesytem to the executable.
argvArgument vector to pass to exec.
inRedirection specification for stdin.
outRedirection specification for stdout.
errRedirection specification for stderr.
flagsFlags to be stringified and appended to 'argv'.
environmentEnvironment variables to use for the new subprocess or if None (the default) then the new subprocess will inherit the environment of the current process.
cloneFunction to be invoked in order to fork/clone the subprocess.
parent_hooksHooks that will be executed in the parent before the child execs.
child_hooksHooks that will be executed in the child before the child execs but after parent_hooks have executed.
Returns
The subprocess or an error if one occurred.
Try<Subprocess> process::subprocess ( const std::string &  command,
const Subprocess::IO in = Subprocess::FD(STDIN_FILENO),
const Subprocess::IO out = Subprocess::FD(STDOUT_FILENO),
const Subprocess::IO err = Subprocess::FD(STDERR_FILENO),
const Option< std::map< std::string, std::string >> &  environment = None(),
const Option< lambda::function< pid_t(const lambda::function< int()> &)>> &  clone = None(),
const std::vector< Subprocess::ParentHook > &  parent_hooks = {},
const std::vector< Subprocess::ChildHook > &  child_hooks = {},
const std::vector< int_fd > &  whitelist_fds = {} 
)
inline

Overload of 'subprocess' for launching a shell command, i.e., 'sh -c command'.

Currently, we do not support flags for shell command variants due to the complexity involved in escaping quotes in flags.

Parameters
commandShell command to execute.
inRedirection specification for stdin.
outRedirection specification for stdout.
errRedirection specification for stderr.
environmentEnvironment variables to use for the new subprocess or if None (the default) then the new subprocess will inherit the environment of the current process.
cloneFunction to be invoked in order to fork/clone the subprocess.
parent_hooksHooks that will be executed in the parent before the child execs.
child_hooksHooks that will be executed in the child before the child execs but after parent_hooks have executed.
Returns
The subprocess or an error if one occurred.
void process::terminate ( const UPID pid,
bool  inject = true 
)

Sends a TerminateEvent to the given process.

NOTE: currently, terminate only works for local processes (in the future we plan to make this more explicit via the use of a PID instead of a UPID).

Parameters
pidThe process to terminate.
injectWhether the message should be injected ahead of all other messages queued up for that process.
See also
process::TerminateEvent
void process::terminate ( const ProcessBase process,
bool  inject 
)
inline

Sends a TerminateEvent to the given process.

NOTE: currently, terminate only works for local processes (in the future we plan to make this more explicit via the use of a PID instead of a UPID).

Parameters
pidThe process to terminate.
injectWhether the message should be injected ahead of all other messages queued up for that process.
See also
process::TerminateEvent
void process::terminate ( const ProcessBase process,
bool  inject 
)
inline

Sends a TerminateEvent to the given process.

NOTE: currently, terminate only works for local processes (in the future we plan to make this more explicit via the use of a PID instead of a UPID).

Parameters
pidThe process to terminate.
injectWhether the message should be injected ahead of all other messages queued up for that process.
See also
process::TerminateEvent
std::string process::TLDR ( const std::string &  tldr)
inline
template<typename T >
Future<T> process::undiscardable ( const Future< T > &  future)
template<typename F , typename std::enable_if< !is_specialization_of< typename std::decay< F >::type, Future >::value, int >::type = 0>
UndiscardableDecorator<typename std::decay<F>::type> process::undiscardable ( F &&  f)
std::string process::USAGE ( const std::string &  usage)
inline
bool process::wait ( const UPID pid,
const Duration duration = Seconds(-1) 
)

Wait for the process to exit for no more than the specified seconds.

Parameters
PIDID of the process.
secsMax time to wait, 0 implies wait forever.
Returns
true if a process was actually waited upon.
bool process::wait ( const ProcessBase process,
const Duration duration 
)
inline

Wait for the process to exit for no more than the specified seconds.

Parameters
PIDID of the process.
secsMax time to wait, 0 implies wait forever.
Returns
true if a process was actually waited upon.
bool process::wait ( const ProcessBase process,
const Duration duration 
)
inline

Wait for the process to exit for no more than the specified seconds.

Parameters
PIDID of the process.
secsMax time to wait, 0 implies wait forever.
Returns
true if a process was actually waited upon.
long process::workers ( )

Returns the number of worker threads the library has created.

A worker thread is a thread that runs a process (i.e., calls ProcessBase::serve).

Variable Documentation

thread_local ProcessBase* process::__process__
thread_local Executor* process::_executor_
thread_local bool * process::_in_event_loop_
ev_async* process::async_watchers
event_base* process::base
F&& process::f
Initial value:
{
return _Deferred<F>(pid, std::forward<F>(f))
F && f
Definition: defer.hpp:270
std::queue<lambda::function<void()> >* process::functions
std::mutex* process::functions_mutexes
const uint32_t process::GZIP_MINIMUM_BODY_LENGTH = 1024
windows::EventLoop* process::libwinio_loop
struct ev_loop** process::loops
constexpr char process::READONLY_HTTP_AUTHENTICATION_REALM[] = "libprocess-readonly"
constexpr char process::READWRITE_HTTP_AUTHENTICATION_REALM[] = "libprocess-readwrite"
SocketManager* process::socket_manager
Duration process::TEST_AWAIT_TIMEOUT
constexpr size_t process::TIME_SERIES_CAPACITY = 1000
constexpr Duration process::TIME_SERIES_WINDOW = Weeks(2)