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
34f3758b
Commit
34f3758b
authored
Jan 19, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into topic/remove-atom
parents
18def4a5
264d14b6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
86 additions
and
5 deletions
+86
-5
libcaf_core/caf/detail/parser/read_ini.hpp
libcaf_core/caf/detail/parser/read_ini.hpp
+1
-1
libcaf_core/caf/fused_downstream_manager.hpp
libcaf_core/caf/fused_downstream_manager.hpp
+2
-0
libcaf_core/caf/policy/fan_in_responses.hpp
libcaf_core/caf/policy/fan_in_responses.hpp
+2
-1
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+2
-0
libcaf_core/src/error.cpp
libcaf_core/src/error.cpp
+0
-2
libcaf_core/src/scheduled_actor.cpp
libcaf_core/src/scheduled_actor.cpp
+15
-0
libcaf_core/src/scheduler/test_coordinator.cpp
libcaf_core/src/scheduler/test_coordinator.cpp
+12
-1
libcaf_core/test/detail/parser/read_ini.cpp
libcaf_core/test/detail/parser/read_ini.cpp
+52
-0
No files found.
libcaf_core/caf/detail/parser/read_ini.hpp
View file @
34f3758b
...
...
@@ -113,7 +113,7 @@ void read_ini_map(State& ps, Consumer&& consumer) {
state
(
await_key_name
)
{
transition
(
await_key_name
,
"
\t\n
"
)
fsm_epsilon
(
read_ini_comment
(
ps
,
consumer
),
await_key_name
,
';'
)
transition
(
read_key_name
,
alpha
bet
ic_chars
,
key
=
ch
)
transition
(
read_key_name
,
alpha
numer
ic_chars
,
key
=
ch
)
transition
(
done
,
'}'
,
consumer
.
end_map
())
}
// Reads a key of a "key=value" line.
...
...
libcaf_core/caf/fused_downstream_manager.hpp
View file @
34f3758b
...
...
@@ -212,6 +212,8 @@ public:
return
i
->
second
.
ptr
;
}
using
downstream_manager
::
close
;
void
close
()
override
{
CAF_LOG_TRACE
(
CAF_ARG
(
paths_
));
for
(
auto
ptr
:
ptrs_
)
...
...
libcaf_core/caf/policy/fan_in_responses.hpp
View file @
34f3758b
...
...
@@ -189,7 +189,8 @@ public:
};
for
(
auto
id
:
ids_
)
{
typename
Self
::
accept_one_cond
rc
;
self
->
varargs_receive
(
rc
,
id
,
helper
.
wrap
(),
error_handler
);
auto
error_handler_copy
=
error_handler
;
self
->
varargs_receive
(
rc
,
id
,
helper
.
wrap
(),
error_handler_copy
);
}
}
...
...
libcaf_core/src/actor_system_config.cpp
View file @
34f3758b
...
...
@@ -402,6 +402,8 @@ timespan actor_system_config::stream_tick_duration() const noexcept {
return
timespan
{
ns_count
};
}
std
::
string
actor_system_config
::
render
(
const
error
&
x
)
{
if
(
!
x
)
return
"none"
;
switch
(
x
.
category
())
{
case
error_category
<
sec
>
:
:
value
:
return
render_sec
(
x
.
code
(),
x
.
context
());
...
...
libcaf_core/src/error.cpp
View file @
34f3758b
...
...
@@ -170,8 +170,6 @@ void error::init() {
}
std
::
string
to_string
(
const
error
&
x
)
{
if
(
!
x
)
return
"none"
;
return
actor_system_config
::
render
(
x
);
}
...
...
libcaf_core/src/scheduled_actor.cpp
View file @
34f3758b
...
...
@@ -837,6 +837,21 @@ bool scheduled_actor::finalize() {
// Repeated calls always return `true` but have no side effects.
if
(
getf
(
is_cleaned_up_flag
))
return
true
;
// TODO: This is a workaround for issue #1011. Iterating over all stream
// managers here and dropping them as needed prevents the
// never-terminating part, but it still means that "dead" stream manager
// can accumulate over time since we only run this O(n) path if the
// actor is shutting down.
if
(
!
has_behavior
()
&&
!
stream_managers_
.
empty
())
{
for
(
auto
i
=
stream_managers_
.
begin
();
i
!=
stream_managers_
.
end
();)
{
if
(
i
->
second
->
done
())
i
=
stream_managers_
.
erase
(
i
);
else
++
i
;
if
(
stream_managers_
.
empty
())
stream_ticks_
.
stop
();
}
}
// An actor is considered alive as long as it has a behavior and didn't set
// the terminated flag.
if
(
alive
())
...
...
libcaf_core/src/scheduler/test_coordinator.cpp
View file @
34f3758b
...
...
@@ -74,6 +74,7 @@ detail::test_actor_clock& test_coordinator::clock() noexcept {
}
void
test_coordinator
::
start
()
{
CAF_LOG_TRACE
(
""
);
dummy_worker
worker
{
this
};
actor_config
cfg
{
&
worker
};
auto
&
sys
=
system
();
...
...
@@ -82,6 +83,7 @@ void test_coordinator::start() {
}
void
test_coordinator
::
stop
()
{
CAF_LOG_TRACE
(
""
);
while
(
run
()
>
0
)
trigger_timeouts
();
}
...
...
@@ -90,6 +92,7 @@ void test_coordinator::enqueue(resumable* ptr) {
CAF_LOG_TRACE
(
""
);
jobs
.
push_back
(
ptr
);
if
(
after_next_enqueue_
!=
nullptr
)
{
CAF_LOG_DEBUG
(
"inline this enqueue"
);
std
::
function
<
void
()
>
f
;
f
.
swap
(
after_next_enqueue_
);
f
();
...
...
@@ -97,6 +100,7 @@ void test_coordinator::enqueue(resumable* ptr) {
}
bool
test_coordinator
::
try_run_once
()
{
CAF_LOG_TRACE
(
""
);
if
(
jobs
.
empty
())
return
false
;
auto
job
=
jobs
.
front
();
...
...
@@ -117,6 +121,7 @@ bool test_coordinator::try_run_once() {
}
bool
test_coordinator
::
try_run_once_lifo
()
{
CAF_LOG_TRACE
(
""
);
if
(
jobs
.
empty
())
return
false
;
if
(
jobs
.
size
()
>=
2
)
...
...
@@ -125,18 +130,21 @@ bool test_coordinator::try_run_once_lifo() {
}
void
test_coordinator
::
run_once
()
{
CAF_LOG_TRACE
(
""
);
if
(
jobs
.
empty
())
CAF_RAISE_ERROR
(
"No job to run available."
);
try_run_once
();
}
void
test_coordinator
::
run_once_lifo
()
{
CAF_LOG_TRACE
(
""
);
if
(
jobs
.
empty
())
CAF_RAISE_ERROR
(
"No job to run available."
);
try_run_once_lifo
();
}
size_t
test_coordinator
::
run
(
size_t
max_count
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
max_count
));
size_t
res
=
0
;
while
(
res
<
max_count
&&
try_run_once
())
++
res
;
...
...
@@ -144,16 +152,19 @@ size_t test_coordinator::run(size_t max_count) {
}
void
test_coordinator
::
inline_next_enqueue
()
{
CAF_LOG_TRACE
(
""
);
after_next_enqueue
([
=
]
{
run_once_lifo
();
});
}
void
test_coordinator
::
inline_all_enqueues
()
{
CAF_LOG_TRACE
(
""
);
after_next_enqueue
([
=
]
{
inline_all_enqueues_helper
();
});
}
void
test_coordinator
::
inline_all_enqueues_helper
()
{
run_once_lifo
(
);
CAF_LOG_TRACE
(
""
);
after_next_enqueue
([
=
]
{
inline_all_enqueues_helper
();
});
run_once_lifo
();
}
}
// namespace caf::scheduler
libcaf_core/test/detail/parser/read_ini.cpp
View file @
34f3758b
...
...
@@ -277,4 +277,56 @@ CAF_TEST(invalid inis) {
CAF_CHECK_EQUAL
(
parse
(
ini3
),
ini3_log
);
}
CAF_TEST
(
integer
keys
are
legal
in
INI
syntax
)
{
static
constexpr
string_view
ini
=
R"__(
[foo.bar]
1 = 10
2 = 20
)__"
;
// clang-format off
auto
log
=
make_log
(
"key: foo"
,
"{"
,
"key: bar"
,
"{"
,
"key: 1"
,
"value (integer): 10"
,
"key: 2"
,
"value (integer): 20"
,
"}"
,
"}"
);
// clang-format on
CAF_CHECK_EQUAL
(
parse
(
ini
),
log
);
}
CAF_TEST
(
integer
keys
are
legal
in
config
syntax
)
{
static
constexpr
string_view
ini
=
R"__(
foo {
bar {
1 = 10
2 = 20
}
}
)__"
;
// clang-format off
auto
log
=
make_log
(
"key: global"
,
"{"
,
"key: foo"
,
"{"
,
"key: bar"
,
"{"
,
"key: 1"
,
"value (integer): 10"
,
"key: 2"
,
"value (integer): 20"
,
"}"
,
"}"
,
"}"
);
// clang-format on
CAF_CHECK_EQUAL
(
parse
(
ini
),
log
);
}
CAF_TEST_FIXTURE_SCOPE_END
()
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