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
ddb7092e
Commit
ddb7092e
authored
Jul 07, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give test_coordinator::run_once proper semantics
parent
eba3a1da
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
libcaf_core/caf/scheduler/test_coordinator.hpp
libcaf_core/caf/scheduler/test_coordinator.hpp
+2
-4
libcaf_core/src/test_coordinator.cpp
libcaf_core/src/test_coordinator.cpp
+6
-0
libcaf_test/caf/test/io_dsl.hpp
libcaf_test/caf/test/io_dsl.hpp
+3
-3
No files found.
libcaf_core/caf/scheduler/test_coordinator.hpp
View file @
ddb7092e
...
...
@@ -104,10 +104,8 @@ public:
/// Tries to execute a single event.
bool
try_run_once
();
/// Deprecated. Use `try_run_once()` instead.
inline
bool
run_once
()
CAF_DEPRECATED
{
return
try_run_once
();
}
/// Executes a single event or fails if no event is available.
void
run_once
();
/// Executes events until the job queue is empty and no pending timeouts are
/// left. Returns the number of processed events.
...
...
libcaf_core/src/test_coordinator.cpp
View file @
ddb7092e
...
...
@@ -144,6 +144,12 @@ bool test_coordinator::try_run_once() {
return
true
;
}
void
test_coordinator
::
run_once
()
{
if
(
jobs
.
empty
())
CAF_RAISE_ERROR
(
"No job to run available."
);
try_run_once
();
}
size_t
test_coordinator
::
run
(
size_t
max_count
)
{
size_t
res
=
0
;
while
(
res
<
max_count
&&
try_run_once
())
...
...
libcaf_test/caf/test/io_dsl.hpp
View file @
ddb7092e
...
...
@@ -50,7 +50,7 @@ public:
// all executables on this node.
void
exec_all
()
{
while
(
mpx
.
try_exec_runnable
()
||
mpx
.
read_data
()
||
this
->
sched
.
run_once
())
{
||
this
->
sched
.
try_
run_once
())
{
// rince and repeat
}
}
...
...
@@ -106,7 +106,7 @@ public:
CAF_MESSAGE
(
"tell peer to accept the connection"
);
peer
->
mpx
.
accept_connection
(
peer
->
acc
);
CAF_MESSAGE
(
"run handshake between the two BASP broker instances"
);
while
(
sched
.
run_once
()
||
peer
->
sched
.
run_once
()
while
(
sched
.
try_run_once
()
||
peer
->
sched
.
try_
run_once
()
||
mpx
.
try_exec_runnable
()
||
peer
->
mpx
.
try_exec_runnable
()
||
mpx
.
read_data
()
||
peer
->
mpx
.
read_data
())
{
// re-run until handhsake is fully completed
...
...
@@ -168,7 +168,7 @@ public:
void
exec_all
()
{
run_exhaustively
([](
planet_type
*
x
)
{
return
x
->
mpx
.
try_exec_runnable
()
||
x
->
mpx
.
read_data
()
||
x
->
sched
.
run_once
();
||
x
->
sched
.
try_
run_once
();
});
}
...
...
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