Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
ecd5abc4
Commit
ecd5abc4
authored
Mar 16, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of spawn requests to the local node
parent
40a769a5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
libcaf_io/src/io/middleman_actor_impl.cpp
libcaf_io/src/io/middleman_actor_impl.cpp
+17
-4
No files found.
libcaf_io/src/io/middleman_actor_impl.cpp
View file @
ecd5abc4
...
...
@@ -148,16 +148,29 @@ auto middleman_actor_impl::make_behavior() -> behavior_type {
delegate
(
broker_
,
atm
,
p
);
return
{};
},
[
=
](
spawn_atom
atm
,
node_id
&
nid
,
std
::
string
&
str
,
message
&
msg
,
std
::
set
<
std
::
string
>&
ifs
)
->
delegated
<
strong_actor_ptr
>
{
[
=
](
spawn_atom
atm
,
node_id
&
nid
,
std
::
string
&
name
,
message
&
args
,
std
::
set
<
std
::
string
>&
ifs
)
->
result
<
strong_actor_ptr
>
{
CAF_LOG_TRACE
(
""
);
if
(
!
nid
)
return
make_error
(
sec
::
invalid_argument
,
"cannot spawn actors on invalid nodes"
);
if
(
name
.
empty
())
return
make_error
(
sec
::
invalid_argument
,
"cannot spawn actors without a type name"
);
if
(
nid
==
system
().
node
())
{
if
(
auto
res
=
system
().
spawn
<
actor
>
(
name
,
std
::
move
(
args
),
nullptr
,
true
,
&
ifs
))
return
actor_cast
<
strong_actor_ptr
>
(
std
::
move
(
*
res
));
else
return
std
::
move
(
res
.
error
());
}
// This local variable prevents linker errors (delegate forms an lvalue
// reference but spawn_server_id is constexpr).
auto
id
=
basp
::
header
::
spawn_server_id
;
delegate
(
broker_
,
forward_atom_v
,
nid
,
id
,
make_message
(
atm
,
std
::
move
(
str
),
std
::
move
(
msg
),
make_message
(
atm
,
std
::
move
(
name
),
std
::
move
(
args
),
std
::
move
(
ifs
)));
return
{};
return
delegated
<
strong_actor_ptr
>
{};
},
[
=
](
get_atom
atm
,
node_id
nid
)
->
delegated
<
node_id
,
std
::
string
,
uint16_t
>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment