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
08c85d65
Commit
08c85d65
authored
Mar 03, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kill all proxies in basp_broker::on_exit
parent
667a5950
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
libcaf_core/caf/actor_namespace.hpp
libcaf_core/caf/actor_namespace.hpp
+17
-0
libcaf_core/src/actor_namespace.cpp
libcaf_core/src/actor_namespace.cpp
+4
-0
libcaf_io/src/basp_broker.cpp
libcaf_io/src/basp_broker.cpp
+6
-0
No files found.
libcaf_core/caf/actor_namespace.hpp
View file @
08c85d65
...
@@ -110,6 +110,23 @@ class actor_namespace {
...
@@ -110,6 +110,23 @@ class actor_namespace {
*/
*/
bool
empty
()
const
;
bool
empty
()
const
;
/**
* Deletes all proxies.
*/
void
clear
();
template
<
class
F
>
void
for_each
(
F
fun
)
{
for
(
auto
&
outer
:
m_proxies
)
{
for
(
auto
&
inner
:
outer
.
second
)
{
auto
ptr
=
inner
.
second
->
get
();
if
(
ptr
)
{
fun
(
ptr
);
}
}
}
}
private:
private:
backend
&
m_backend
;
backend
&
m_backend
;
std
::
map
<
key_type
,
proxy_map
>
m_proxies
;
std
::
map
<
key_type
,
proxy_map
>
m_proxies
;
...
...
libcaf_core/src/actor_namespace.cpp
View file @
08c85d65
...
@@ -149,4 +149,8 @@ void actor_namespace::erase(const key_type& inf, actor_id aid) {
...
@@ -149,4 +149,8 @@ void actor_namespace::erase(const key_type& inf, actor_id aid) {
}
}
}
}
void
actor_namespace
::
clear
()
{
m_proxies
.
clear
();
}
}
// namespace caf
}
// namespace caf
libcaf_io/src/basp_broker.cpp
View file @
08c85d65
...
@@ -695,6 +695,12 @@ actor_proxy_ptr basp_broker::make_proxy(const node_id& nid, actor_id aid) {
...
@@ -695,6 +695,12 @@ actor_proxy_ptr basp_broker::make_proxy(const node_id& nid, actor_id aid) {
void
basp_broker
::
on_exit
()
{
void
basp_broker
::
on_exit
()
{
CAF_LOG_TRACE
(
""
);
CAF_LOG_TRACE
(
""
);
// kill all remaining proxies
m_namespace
.
for_each
([](
const
actor_proxy_ptr
&
ptr
)
{
ptr
->
kill_proxy
(
exit_reason
::
remote_link_unreachable
);
});
m_namespace
.
clear
();
// remove all remaining state
m_ctx
.
clear
();
m_ctx
.
clear
();
m_acceptors
.
clear
();
m_acceptors
.
clear
();
m_open_ports
.
clear
();
m_open_ports
.
clear
();
...
...
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