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
89f9b6f3
Commit
89f9b6f3
authored
Mar 05, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `remove_input_path` function to stream manager
parent
67fcb31b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
0 deletions
+37
-0
libcaf_core/caf/local_actor.hpp
libcaf_core/caf/local_actor.hpp
+4
-0
libcaf_core/caf/scheduled_actor.hpp
libcaf_core/caf/scheduled_actor.hpp
+2
-0
libcaf_core/caf/stream_manager.hpp
libcaf_core/caf/stream_manager.hpp
+3
-0
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+4
-0
libcaf_core/src/scheduled_actor.cpp
libcaf_core/src/scheduled_actor.cpp
+16
-0
libcaf_core/src/stream_manager.cpp
libcaf_core/src/stream_manager.cpp
+8
-0
No files found.
libcaf_core/caf/local_actor.hpp
View file @
89f9b6f3
...
...
@@ -408,6 +408,10 @@ public:
/// Silently closes incoming stream traffic on `slot`.
virtual
void
erase_inbound_path_later
(
stream_slot
slot
);
/// Closes incoming stream traffic on `slot`. Emits a drop message on the
/// path if `reason == none` and a `forced_drop` message otherwise.
virtual
void
erase_inbound_path_later
(
stream_slot
slot
,
error
reason
);
/// Silently closes all inbound paths for `mgr`.
virtual
void
erase_inbound_paths_later
(
const
stream_manager
*
mgr
);
...
...
libcaf_core/caf/scheduled_actor.hpp
View file @
89f9b6f3
...
...
@@ -737,6 +737,8 @@ public:
void
erase_inbound_path_later
(
stream_slot
slot
)
override
;
void
erase_inbound_path_later
(
stream_slot
slot
,
error
reason
)
override
;
void
erase_inbound_paths_later
(
const
stream_manager
*
mgr
)
override
;
void
erase_inbound_paths_later
(
const
stream_manager
*
mgr
,
...
...
libcaf_core/caf/stream_manager.hpp
View file @
89f9b6f3
...
...
@@ -138,6 +138,9 @@ public:
/// This function is called from the destructor of `inbound_path`.
virtual
void
deregister_input_path
(
inbound_path
*
x
)
noexcept
;
/// Removes an input path
virtual
void
remove_input_path
(
stream_slot
slot
,
error
reason
,
bool
silent
);
// -- mutators ---------------------------------------------------------------
/// Adds a response promise to a sink for delivering the final result.
...
...
libcaf_core/src/local_actor.cpp
View file @
89f9b6f3
...
...
@@ -134,6 +134,10 @@ void local_actor::erase_inbound_path_later(stream_slot) {
CAF_LOG_ERROR
(
"local_actor::erase_inbound_path_later called"
);
}
void
local_actor
::
erase_inbound_path_later
(
stream_slot
,
error
)
{
CAF_LOG_ERROR
(
"local_actor::erase_inbound_path_later called"
);
}
void
local_actor
::
erase_inbound_paths_later
(
const
stream_manager
*
)
{
CAF_LOG_ERROR
(
"local_actor::erase_inbound_paths_later called"
);
}
...
...
libcaf_core/src/scheduled_actor.cpp
View file @
89f9b6f3
...
...
@@ -842,6 +842,22 @@ void scheduled_actor::erase_inbound_path_later(stream_slot slot) {
get_downstream_queue
().
erase_later
(
slot
);
}
void
scheduled_actor
::
erase_inbound_path_later
(
stream_slot
slot
,
error
reason
)
{
auto
&
q
=
get_downstream_queue
();
auto
e
=
q
.
queues
().
end
();
auto
i
=
q
.
queues
().
find
(
slot
);
if
(
i
!=
e
)
{
auto
&
path
=
i
->
second
.
policy
().
handler
;
if
(
path
!=
nullptr
)
{
if
(
reason
==
none
)
path
->
emit_regular_shutdown
(
this
);
else
path
->
emit_irregular_shutdown
(
this
,
std
::
move
(
reason
));
}
q
.
erase_later
(
slot
);
}
}
void
scheduled_actor
::
erase_inbound_paths_later
(
const
stream_manager
*
ptr
)
{
CAF_LOG_TRACE
(
""
);
for
(
auto
&
kvp
:
get_downstream_queue
().
queues
())
{
...
...
libcaf_core/src/stream_manager.cpp
View file @
89f9b6f3
...
...
@@ -176,6 +176,14 @@ void stream_manager::deregister_input_path(inbound_path* ptr) noexcept {
CAF_LOG_DEBUG
(
inbound_paths_
.
size
()
<<
"paths remaining"
);
}
void
stream_manager
::
remove_input_path
(
stream_slot
slot
,
error
reason
,
bool
silent
)
{
if
(
silent
)
self_
->
erase_inbound_path_later
(
slot
);
else
self_
->
erase_inbound_path_later
(
slot
,
std
::
move
(
reason
));
}
void
stream_manager
::
add_promise
(
response_promise
x
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
x
));
CAF_ASSERT
(
out
().
terminal
());
...
...
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