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
29e06858
Commit
29e06858
authored
Mar 16, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pick a sane default for run_dispatch_loop
parent
647ceea6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
libcaf_core/caf/scheduler/test_coordinator.hpp
libcaf_core/caf/scheduler/test_coordinator.hpp
+4
-3
libcaf_core/src/test_coordinator.cpp
libcaf_core/src/test_coordinator.cpp
+5
-0
No files found.
libcaf_core/caf/scheduler/test_coordinator.hpp
View file @
29e06858
...
...
@@ -116,14 +116,15 @@ public:
/// Loops until no job or delayed message remains or `predicate` returns
/// `true`. Returns the total number of events (first) and dispatched delayed
/// messages (second). Advances time by `cycle`
between to calls to
///
`dispatch()`
.
/// messages (second). Advances time by `cycle`
nanoseconds between to calls
///
to `dispatch()` or the default tick-duration when passing 0ns
.
std
::
pair
<
size_t
,
size_t
>
run_dispatch_loop
(
std
::
function
<
bool
()
>
predicate
,
timespan
cycle
=
timespan
{
0
});
/// Loops until no job or delayed message remains. Returns the total number
/// of events (first) and dispatched delayed messages (second). Advances time
/// by `cycle` between to calls to `dispatch()`.
/// by `cycle` nanoseconds between to calls to `dispatch()` or the default
/// tick-duration when passing 0ns.
std
::
pair
<
size_t
,
size_t
>
run_dispatch_loop
(
timespan
cycle
=
timespan
{
0
});
template
<
class
F
>
...
...
libcaf_core/src/test_coordinator.cpp
View file @
29e06858
...
...
@@ -22,6 +22,7 @@
#include "caf/resumable.hpp"
#include "caf/monitorable_actor.hpp"
#include "caf/actor_system_config.hpp"
namespace
caf
{
namespace
scheduler
{
...
...
@@ -157,6 +158,10 @@ std::pair<size_t, size_t>
test_coordinator
::
run_dispatch_loop
(
std
::
function
<
bool
()
>
predicate
,
timespan
cycle
)
{
std
::
pair
<
size_t
,
size_t
>
res
{
0
,
0
};
if
(
cycle
.
count
()
==
0
)
{
auto
x
=
system
().
config
().
streaming_tick_duration_us
();
cycle
=
std
::
chrono
::
microseconds
(
x
);
}
for
(;;)
{
size_t
progress
=
0
;
while
(
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