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
a0462d6c
Commit
a0462d6c
authored
Jun 24, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow dropping of individual upstream actors
parent
97ba6743
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
libcaf_core/caf/upstream_policy.hpp
libcaf_core/caf/upstream_policy.hpp
+6
-1
libcaf_core/src/upstream_policy.cpp
libcaf_core/src/upstream_policy.cpp
+4
-1
No files found.
libcaf_core/caf/upstream_policy.hpp
View file @
a0462d6c
...
...
@@ -25,6 +25,8 @@
#include <utility>
#include "caf/fwd.hpp"
#include "caf/none.hpp"
#include "caf/error.hpp"
namespace
caf
{
...
...
@@ -89,7 +91,10 @@ public:
stream_priority
prio
,
long
downstream_credit
);
bool
remove_path
(
const
strong_actor_ptr
&
hdl
);
/// Removes `hdl` as upstream actor. The actor is removed without any further
/// signaling if `err == none`, otherwise the upstream actor receives an
/// abort message.
bool
remove_path
(
const
strong_actor_ptr
&
hdl
,
error
err
=
none
);
upstream_path
*
find
(
const
strong_actor_ptr
&
x
)
const
;
...
...
libcaf_core/src/upstream_policy.cpp
View file @
a0462d6c
...
...
@@ -92,7 +92,7 @@ expected<long> upstream_policy::add_path(strong_actor_ptr hdl,
return
sec
::
upstream_already_exists
;
}
bool
upstream_policy
::
remove_path
(
const
strong_actor_ptr
&
hdl
)
{
bool
upstream_policy
::
remove_path
(
const
strong_actor_ptr
&
hdl
,
error
err
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
hdl
));
// Find element in our paths list.
auto
has_hdl
=
[
&
](
const
path_uptr
&
x
)
{
...
...
@@ -115,6 +115,9 @@ bool upstream_policy::remove_path(const strong_actor_ptr& hdl) {
// Drop path from list.
if
(
i
!=
e
-
1
)
std
::
swap
(
*
i
,
paths_
.
back
());
if
(
err
!=
none
)
unsafe_send_as
(
self_
,
hdl
,
make
<
stream_msg
::
abort
>
(
paths_
.
back
()
->
sid
,
std
::
move
(
err
)));
paths_
.
pop_back
();
return
true
;
}
...
...
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