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
26bb9cda
Commit
26bb9cda
authored
Jul 06, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow 'testing' multiplexer backend option
parent
27f564bb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
27 deletions
+34
-27
libcaf_io/caf/io/network/test_multiplexer.hpp
libcaf_io/caf/io/network/test_multiplexer.hpp
+5
-0
libcaf_io/src/middleman.cpp
libcaf_io/src/middleman.cpp
+29
-27
No files found.
libcaf_io/caf/io/network/test_multiplexer.hpp
View file @
26bb9cda
...
@@ -164,6 +164,11 @@ public:
...
@@ -164,6 +164,11 @@ public:
inline_next_runnables
(
1
);
inline_next_runnables
(
1
);
}
}
/// Resets the counter for the next inlined runnables.
inline
void
reset_inlining
()
{
inline_runnables_
=
0
;
}
/// Installs a callback that is triggered on the next inlined runnable.
/// Installs a callback that is triggered on the next inlined runnable.
inline
void
after_next_inlined_runnable
(
std
::
function
<
void
()
>
f
)
{
inline
void
after_next_inlined_runnable
(
std
::
function
<
void
()
>
f
)
{
inline_runnable_callback_
=
std
::
move
(
f
);
inline_runnable_callback_
=
std
::
move
(
f
);
...
...
libcaf_io/src/middleman.cpp
View file @
26bb9cda
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
#include "caf/io/system_messages.hpp"
#include "caf/io/system_messages.hpp"
#include "caf/io/network/interfaces.hpp"
#include "caf/io/network/interfaces.hpp"
#include "caf/io/network/test_multiplexer.hpp"
#include "caf/io/network/default_multiplexer.hpp"
#include "caf/io/network/default_multiplexer.hpp"
#include "caf/scheduler/abstract_coordinator.hpp"
#include "caf/scheduler/abstract_coordinator.hpp"
...
@@ -71,10 +72,12 @@
...
@@ -71,10 +72,12 @@
namespace
caf
{
namespace
caf
{
namespace
io
{
namespace
io
{
actor_system
::
module
*
middleman
::
make
(
actor_system
&
sys
,
detail
::
type_list
<>
)
{
namespace
{
class
impl
:
public
middleman
{
public:
template
<
class
T
>
impl
(
actor_system
&
ref
)
:
middleman
(
ref
),
backend_
(
&
ref
)
{
class
mm_impl
:
public
middleman
{
public:
mm_impl
(
actor_system
&
ref
)
:
middleman
(
ref
),
backend_
(
&
ref
)
{
// nop
// nop
}
}
...
@@ -82,27 +85,23 @@ actor_system::module* middleman::make(actor_system& sys, detail::type_list<>) {
...
@@ -82,27 +85,23 @@ actor_system::module* middleman::make(actor_system& sys, detail::type_list<>) {
return
backend_
;
return
backend_
;
}
}
private:
private:
network
::
default_multiplexer
backend_
;
T
backend_
;
};
};
# ifdef CAF_USE_ASIO
class
asio_impl
:
public
middleman
{
public:
asio_impl
(
actor_system
&
ref
)
:
middleman
(
ref
),
backend_
(
&
ref
)
{
// nop
}
network
::
multiplexer
&
backend
()
override
{
}
// namespace <anonymous>
return
backend_
;
}
private:
actor_system
::
module
*
middleman
::
make
(
actor_system
&
sys
,
detail
::
type_list
<>
)
{
network
::
asio_multiplexer
backend_
;
switch
(
atom_uint
(
sys
.
config
().
middleman_network_backend
))
{
};
# ifdef CAF_USE_ASIO
if
(
sys
.
config
().
middleman_network_backend
==
atom
(
"asio"
))
case
atom_uint
(
atom
(
"asio"
)):
return
new
asio_impl
(
sys
);
return
new
mm_impl
<
network
::
asio_multiplexer
>
(
sys
);
# endif // CAF_USE_ASIO
# endif // CAF_USE_ASIO
return
new
impl
(
sys
);
case
atom_uint
(
atom
(
"testing"
)):
return
new
mm_impl
<
network
::
test_multiplexer
>
(
sys
);
default:
return
new
mm_impl
<
network
::
default_multiplexer
>
(
sys
);
}
}
}
middleman
::
middleman
(
actor_system
&
sys
)
:
system_
(
sys
)
{
middleman
::
middleman
(
actor_system
&
sys
)
:
system_
(
sys
)
{
...
@@ -403,6 +402,9 @@ void middleman::stop() {
...
@@ -403,6 +402,9 @@ void middleman::stop() {
}
}
void
middleman
::
init
(
actor_system_config
&
cfg
)
{
void
middleman
::
init
(
actor_system_config
&
cfg
)
{
// never detach actors when using the testing multiplexer
if
(
cfg
.
middleman_network_backend
==
atom
(
"testing"
))
cfg
.
middleman_detach_utility_actors
=
false
;
// add remote group module to config
// add remote group module to config
struct
remote_groups
:
group_module
{
struct
remote_groups
:
group_module
{
public:
public:
...
...
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