rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
messages.hpp
1#pragma once
2
3//
4// Copyright (c) 2019-2022 Ivan Baidakou (basiliscos) (the dot dmol at gmail dot com)
5//
6// Distributed under the MIT Software License
7//
8
9#include "address.hpp"
10#include "message.h"
11#include "state.h"
12#include "request.hpp"
13#include "subscription_point.h"
14#include "forward.hpp"
15#include "extended_error.h"
16
17#if defined(_MSC_VER)
18#pragma warning(push)
19#pragma warning(disable : 4251)
20#endif
21
22namespace rotor {
23
25namespace payload {
26
32
41
46struct start_actor_t {};
47
58
65 pt::time_duration timeout;
66};
67
80
89
92
94 template <typename Address, typename Reason>
95 shutdown_trigger_t(Address &&address_, Reason &&reason_) noexcept
96 : actor_address(std::forward<Address>(address_)), reason(std::forward<Reason>(reason_)) {}
97};
98
104
112
114 template <typename Reason>
115 explicit shutdown_request_t(Reason &&reason_) noexcept : reason(std::forward<Reason>(reason_)) {}
116
119};
120
141
156
168
180
192
201
206
220
229
235 std::string service_name;
236};
237
245
256
264
275
280
291
300
311
312} // namespace payload
313
315namespace message {
316
317// subscription-related
324
329
336
337// lifetime-related
342
345
352
355
358
359// registry-related
368
379
380// link-related
391
392} // namespace message
393
394} // namespace rotor
395
396#if defined(_MSC_VER)
397#pragma warning(pop)
398#endif
Basic namespace for all rotor functionalities.
Definition rotor.hpp:21
intrusive_ptr_t< message_base_t > message_ptr_t
intrusive pointer for message
Definition message.h:115
intrusive_ptr_t< address_t > address_ptr_t
intrusive pointer for address
Definition address.hpp:57
intrusive_ptr_t< extended_error_t > extended_error_ptr_t
intrusive pointer to extended error type
Definition extended_error.h:25
intrusive_ptr_t< actor_base_t > actor_ptr_t
intrusive pointer for actor
Definition forward.hpp:23
intrusive_ptr_t< handler_base_t > handler_ptr_t
intrusive pointer for handler
Definition forward.hpp:26
the generic message meant to hold user-specific payload
Definition message.h:80
Message with this payload is sent to the target address supervisor for confirming unsubscription in t...
Definition messages.hpp:188
subscription_point_t point
subscription details
Definition messages.hpp:190
Message with this payload is sent to supervisor when an actor is created (constructed).
Definition messages.hpp:55
pt::time_duration timeout
maximum time for actor initialization
Definition messages.hpp:65
actor_ptr_t actor
the intrusive pointer to created actor
Definition messages.hpp:57
deregistration notification for all names associated with service address
Definition messages.hpp:225
address_ptr_t service_addr
service address for deregistration
Definition messages.hpp:227
removes single service by name from a registry
Definition messages.hpp:233
std::string service_name
the name of the service address to be removed for a registry
Definition messages.hpp:235
delayed discovery response as soon as an address has been registered
Definition messages.hpp:260
address_ptr_t service_addr
the service address found by name in a registry
Definition messages.hpp:262
ask registry for discovery_future_t when the target service name has been registered
Definition messages.hpp:269
std::string service_name
the service name to be looked in a registry
Definition messages.hpp:273
successful result of service discovery
Definition messages.hpp:241
address_ptr_t service_addr
the service address found by name in a registry
Definition messages.hpp:243
discover service by name in a registry
Definition messages.hpp:249
std::string service_name
the service name to be looked in a registry
Definition messages.hpp:254
Message with this payload is forwarded to the target address supervisor for recording subscription in...
Definition messages.hpp:152
subscription_point_t point
subscription details
Definition messages.hpp:154
Message with this payload is forwarded to the target address supervisor for recording unsubscription ...
Definition messages.hpp:176
subscription_point_t point
subscription details
Definition messages.hpp:178
Message with this payload is forwarded to the handler's supervisor for the delivery of the original m...
Definition messages.hpp:133
handler_ptr_t handler
The handler (intrusive pointer) on some external supervisor, which can process the original message.
Definition messages.hpp:139
message_ptr_t orig_message
The original message (intrusive pointer) sent to an address.
Definition messages.hpp:135
Message with this payload is sent from a supervisor to an actor as initialization request.
Definition messages.hpp:37
Message with this payload is sent from an actor to its supervisor to confirm successful initializatio...
Definition messages.hpp:31
"name - >service address mapping" request
Definition messages.hpp:210
std::string service_name
(unique) name of the service address in the registry
Definition messages.hpp:215
address_ptr_t service_addr
actual service address
Definition messages.hpp:218
Successful registration response (no content)
Definition messages.hpp:205
Message with this payload is sent from an actor to its supervisor to confirm successful shutdown.
Definition messages.hpp:103
Message with this payload is sent from a supervisor to an actor as shutdown request.
Definition messages.hpp:109
extended_error_ptr_t reason
shutdown reason
Definition messages.hpp:118
shutdown_request_t(Reason &&reason_) noexcept
constructs shutdown request with shutdown reason
Definition messages.hpp:115
Message with this payload is sent to ask an actor's supervisor to initiate shutdown procedure.
Definition messages.hpp:86
shutdown_trigger_t(Address &&address_, Reason &&reason_) noexcept
constructs shutdown trigger for the actor, defined with address, and the shutdown reason
Definition messages.hpp:95
address_ptr_t actor_address
the actor to be shut down
Definition messages.hpp:88
extended_error_ptr_t reason
shutdown reason
Definition messages.hpp:91
Message with this payload is sent to supervisor when spawner should create new actor instance.
Definition messages.hpp:75
address_ptr_t spawner_address
identifies the spawner
Definition messages.hpp:78
Message with this payload is sent from a supervisor to an actor as start confirmation.
Definition messages.hpp:46
Message with this payload is sent from a supervisor to an actor when successful subscription to the t...
Definition messages.hpp:164
subscription_point_t point
subscription details
Definition messages.hpp:166
Message with this payload is sent from a supervisor to an actor with confirmation that point is no lo...
Definition messages.hpp:197
subscription_point_t point
subscription details
Definition messages.hpp:199
pair of handler_base_t linked to particular address_t
Definition subscription_point.h:50