A typed broker mediates between actor systems and other components in the network.
More...
|
void | initialize () override |
|
template<class F , class... Ts> |
infer_handle_from_fun_t< F > | fork (F fun, connection_handle hdl, Ts &&... xs) |
|
expected< connection_handle > | add_tcp_scribe (const std::string &host, uint16_t port) |
|
connection_handle | add_tcp_scribe (network::native_socket fd) |
|
expected< std::pair< accept_handle, uint16_t > > | add_tcp_doorman (uint16_t port=0, const char *in=nullptr, bool reuse_addr=false) |
|
expected< accept_handle > | add_tcp_doorman (network::native_socket fd) |
|
| typed_broker (actor_config &cfg) |
|
template<class T , class... Ts> |
void | become (T &&arg, Ts &&... args) |
| Changes the behavior of this actor. More...
|
|
void | unbecome () |
| Removes the last added behavior. More...
|
|
| local_actor (actor_config &cfg) |
|
void | on_cleanup (const error &) override |
| Called from cleanup to perform extra cleanup actions for this actor.
|
|
void | setup_metrics () |
|
virtual void | launch (scheduler *sched, bool lazy, bool hide)=0 |
|
clock_type::time_point | now () const noexcept |
| Returns the current time.
|
|
disposable | request_response_timeout (timespan d, message_id mid) |
| Requests a new timeout for mid . More...
|
|
template<class... Args> |
void | println (std::string_view fmt, Args &&... args) |
| Adds a new line to stdout.
|
|
template<class... Args> |
void | println (term color, std::string_view fmt, Args &&... args) |
| Adds a new line to stdout.
|
|
template<class T , spawn_options Os = no_spawn_options, class... Ts> |
infer_handle_from_class_t< T > | spawn (Ts &&... xs) |
|
template<spawn_options Options = no_spawn_options, class CustomSpawn , class... Args> |
CustomSpawn::handle_type | spawn (CustomSpawn, Args &&... args) |
|
template<spawn_options Os = no_spawn_options, class F , class... Ts> |
infer_handle_from_fun_t< F > | spawn (F fun, Ts &&... xs) |
|
void | send_exit (const actor_addr &receiver, error reason) |
| Sends an exit message to receiver .
|
|
void | send_exit (const strong_actor_ptr &receiver, error reason) |
| Sends an exit message to receiver .
|
|
template<class Handle > |
void | send_exit (const Handle &receiver, error reason) |
| Sends an exit message to receiver .
|
|
template<message_priority Priority = message_priority::normal, class Handle , class T , class... Ts> |
void | anon_send (const Handle &receiver, T &&arg, Ts &&... args) |
|
template<message_priority Priority = message_priority::normal, class Handle , class T , class... Ts> |
disposable | scheduled_anon_send (const Handle &receiver, actor_clock::time_point timeout, T &&arg, Ts &&... args) |
|
template<message_priority Priority = message_priority::normal, class Handle , class T , class... Ts> |
disposable | delayed_anon_send (const Handle &receiver, actor_clock::duration_type timeout, T &&arg, Ts &&... args) |
|
scheduler * | context () const noexcept |
| Returns the execution unit currently used by this actor.
|
|
void | context (scheduler *x) noexcept |
| Sets the execution unit for this actor.
|
|
actor_system & | system () const noexcept |
| Returns the hosting actor system.
|
|
const actor_system_config & | config () const noexcept |
| Returns the config of the hosting actor system.
|
|
actor_clock & | clock () const noexcept |
| Returns the clock of the actor system.
|
|
strong_actor_ptr & | current_sender () noexcept |
| Returns a pointer to the sender of the current message. More...
|
|
message_id | current_message_id () noexcept |
| Returns the ID of the current message.
|
|
message_id | take_current_message_id () noexcept |
| Returns the ID of the current message and marks the ID stored in the current mailbox element as answered. More...
|
|
void | drop_current_message_id () noexcept |
| Marks the current message ID as answered.
|
|
mailbox_element * | current_mailbox_element () noexcept |
| Returns a pointer to the currently processed mailbox element.
|
|
void | monitor (const node_id &node) |
| Adds a unidirectional monitor to node . More...
|
|
template<message_priority P = message_priority::normal, class Handle > |
void | monitor (const Handle &whom) |
| Adds a unidirectional monitor to whom . More...
|
|
template<typename Handle , typename Fn > |
disposable | monitor (Handle whom, Fn func) |
| Adds a unidirectional monitor to whom with custom callback. More...
|
|
void | demonitor (const actor_addr &whom) |
| Removes a monitor from whom .
|
|
void | demonitor (const strong_actor_ptr &whom) |
| Removes a monitor from whom .
|
|
void | demonitor (const node_id &node) |
| Removes a monitor from node .
|
|
template<class Handle > |
void | demonitor (const Handle &whom) |
| Removes a monitor from whom .
|
|
virtual void | on_exit () |
| Can be overridden to perform cleanup code after an actor finished execution. More...
|
|
template<class... Ts> |
detail::response_promise_t< Ts... > | make_response_promise () |
| Creates a typed_response_promise to respond to a request later on. More...
|
|
response_promise | make_response_promise () |
| Creates a response_promise to respond to a request later on.
|
|
const char * | name () const override |
| Returns an implementation-dependent name for logging purposes, which is only valid as long as the actor is running. More...
|
|
virtual error | save_state (serializer &sink, unsigned int version) |
| Serializes the state of this actor to sink . More...
|
|
virtual error | load_state (deserializer &source, unsigned int version) |
| Deserializes the state of this actor from source . More...
|
|
const error & | fail_state () const noexcept |
| Returns the currently defined fail state. More...
|
|
| abstract_actor (const abstract_actor &)=delete |
|
abstract_actor & | operator= (const abstract_actor &)=delete |
|
void | attach (attachable_ptr ptr) |
| Attaches ptr to this actor. More...
|
|
template<class F > |
void | attach_functor (F f) |
| Convenience function that attaches the functor f to this actor. More...
|
|
size_t | detach (const attachable::token &what) |
| Detaches the first attached object that matches what .
|
|
void | link_to (const actor_addr &other) |
| Links this actor to other .
|
|
template<class ActorHandle > |
void | link_to (const ActorHandle &other) |
| Links this actor to other .
|
|
void | unlink_from (const actor_addr &other) |
| Unlinks this actor from addr .
|
|
template<class ActorHandle > |
void | unlink_from (const ActorHandle &other) |
| Links this actor to hdl .
|
|
virtual std::set< std::string > | message_types () const |
| Returns the set of accepted messages types as strings or an empty set if this actor is untyped. More...
|
|
actor_id | id () const noexcept |
| Returns the ID of this actor.
|
|
node_id | node () const noexcept |
| Returns the node this actor is living on.
|
|
actor_system & | home_system () const noexcept |
| Returns the system that created this actor (or proxy).
|
|
actor_control_block * | ctrl () const |
| Returns the control block for this actor.
|
|
actor_addr | address () const noexcept |
| Returns the logical actor address.
|
|
virtual bool | enqueue (mailbox_element_ptr what, scheduler *sched)=0 |
| Enqueues a new message wrapped in a mailbox_element to the actor. More...
|
|
virtual mailbox_element * | peek_at_next_mailbox_element () |
| Called by the testing DSL to peek at the next element in the mailbox. More...
|
|
bool | cleanup (error &&reason, scheduler *sched) |
| Called by the runtime system to perform cleanup actions for this actor. More...
|
|
template<class... Sigs>
class caf::io::typed_broker< Sigs >
A typed broker mediates between actor systems and other components in the network.