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
143
158
170
182
194
203
208
222
231
237 std::string service_name;
238};
239
247
258
266
277
282
293
302
313
314} // namespace payload
315
317namespace message {
318
319// subscription-related
326
331
338
339// lifetime-related
344
347
354
357
360
361// registry-related
370
381
382// link-related
393
394} // namespace message
395
396} // namespace rotor
397
398#if defined(_MSC_VER)
399#pragma warning(pop)
400#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:118
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:83
Message with this payload is sent to the target address supervisor for confirming unsubscription in t...
Definition messages.hpp:190
subscription_point_t point
subscription details
Definition messages.hpp:192
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:227
address_ptr_t service_addr
service address for deregistration
Definition messages.hpp:229
removes single service by name from a registry
Definition messages.hpp:235
std::string service_name
the name of the service address to be removed for a registry
Definition messages.hpp:237
delayed discovery response as soon as an address has been registered
Definition messages.hpp:262
address_ptr_t service_addr
the service address found by name in a registry
Definition messages.hpp:264
ask registry for discovery_future_t when the target service name has been registered
Definition messages.hpp:271
std::string service_name
the service name to be looked in a registry
Definition messages.hpp:275
successful result of service discovery
Definition messages.hpp:243
address_ptr_t service_addr
the service address found by name in a registry
Definition messages.hpp:245
discover service by name in a registry
Definition messages.hpp:251
std::string service_name
the service name to be looked in a registry
Definition messages.hpp:256
Message with this payload is forwarded to the target address supervisor for recording subscription in...
Definition messages.hpp:154
subscription_point_t point
subscription details
Definition messages.hpp:156
Message with this payload is forwarded to the target address supervisor for recording unsubscription ...
Definition messages.hpp:178
subscription_point_t point
subscription details
Definition messages.hpp:180
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:141
message_ptr_t orig_message
The original message (intrusive pointer) sent to an address.
Definition messages.hpp:137
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:212
std::string service_name
(unique) name of the service address in the registry
Definition messages.hpp:217
address_ptr_t service_addr
actual service address
Definition messages.hpp:220
Successful registration response (no content)
Definition messages.hpp:207
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:166
subscription_point_t point
subscription details
Definition messages.hpp:168
Message with this payload is sent from a supervisor to an actor with confirmation that point is no lo...
Definition messages.hpp:199
subscription_point_t point
subscription details
Definition messages.hpp:201
pair of handler_base_t linked to particular address_t
Definition subscription_point.h:50