MakerLabs ACM
actor.h
Go to the documentation of this file.
1 /*
2  * Copyright Paul Reimer, 2018
3  *
4  * This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Unported License.
5  * To view a copy of this license, visit
6  * https://creativecommons.org/licenses/by-nc-sa/4.0/
7  * or send a letter to
8  * Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
9  */
10 
11 #pragma once
12 
13 #include "behaviour.h"
14 #include "process.h"
15 
16 namespace ActorModel {
17 
18 // Single actor behaviour convenience function
19 auto spawn(
20  const ActorBehaviour&& _actor_behaviour,
21  const ExecConfigCallback&& _exec_config_callback = nullptr
22 ) -> Pid;
23 
24 auto spawn_link(
25  const Pid& _initial_link_pid,
26  const ActorBehaviour&& _actor_behaviour,
27  const ExecConfigCallback&& _exec_config_callback = nullptr
28 ) -> Pid;
29 
30 // Multiple chained actor behaviours
31 auto spawn(
32  const ActorBehaviours&& _actor_behaviours,
33  const ExecConfigCallback&& _exec_config_callback = nullptr
34 ) -> Pid;
35 
36 auto spawn_link(
37  const Pid& _initial_link_pid,
38  const ActorBehaviours&& _actor_behaviours,
39  const ExecConfigCallback&& _exec_config_callback = nullptr
40 ) -> Pid;
41 
42 } // namespace ActorModel
delegate< void(ProcessExecutionConfigBuilder &)> ExecConfigCallback
Definition: node.h:30
auto spawn(const ActorBehaviour &&_actor_behaviour, const ExecConfigCallback &&_exec_config_callback) -> Pid
Definition: actor.cpp:27
Definition: actor.cpp:17
auto spawn_link(const Pid &_initial_link_pid, const ActorBehaviour &&_actor_behaviour, const ExecConfigCallback &&_exec_config_callback) -> Pid
Definition: actor.cpp:39
UUID::UUID Pid
Definition: pid.h:19
std::vector< ActorBehaviour > ActorBehaviours
Definition: behaviour.h:75
delegate< ResultUnion(const Pid &, StatePtr &state, const Message &)> ActorBehaviour
Definition: behaviour.h:73