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
0d1de2d6
Commit
0d1de2d6
authored
Nov 07, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging output to fan_in policy
parent
15715406
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
libcaf_core/caf/policy/fan_in_responses.hpp
libcaf_core/caf/policy/fan_in_responses.hpp
+7
-0
No files found.
libcaf_core/caf/policy/fan_in_responses.hpp
View file @
0d1de2d6
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include "caf/detail/type_traits.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/detail/typed_actor_util.hpp"
#include "caf/detail/typed_actor_util.hpp"
#include "caf/error.hpp"
#include "caf/error.hpp"
#include "caf/logger.hpp"
#include "caf/message_id.hpp"
#include "caf/message_id.hpp"
namespace
caf
{
namespace
caf
{
...
@@ -42,6 +43,7 @@ struct fan_in_responses_helper {
...
@@ -42,6 +43,7 @@ struct fan_in_responses_helper {
F
f
;
F
f
;
void
operator
()(
T
&
x
)
{
void
operator
()(
T
&
x
)
{
CAF_LOG_TRACE
(
CAF_ARG2
(
"pending"
,
*
pending
));
if
(
*
pending
>
0
)
{
if
(
*
pending
>
0
)
{
results
.
emplace_back
(
std
::
move
(
x
));
results
.
emplace_back
(
std
::
move
(
x
));
if
(
--*
pending
==
0
)
if
(
--*
pending
==
0
)
...
@@ -69,6 +71,7 @@ struct fan_in_responses_tuple_helper {
...
@@ -69,6 +71,7 @@ struct fan_in_responses_tuple_helper {
F
f
;
F
f
;
void
operator
()(
Ts
&
...
xs
)
{
void
operator
()(
Ts
&
...
xs
)
{
CAF_LOG_TRACE
(
CAF_ARG2
(
"pending"
,
*
pending
));
if
(
*
pending
>
0
)
{
if
(
*
pending
>
0
)
{
results
.
emplace_back
(
std
::
move
(
xs
)...);
results
.
emplace_back
(
std
::
move
(
xs
)...);
if
(
--*
pending
==
0
)
if
(
--*
pending
==
0
)
...
@@ -117,6 +120,7 @@ public:
...
@@ -117,6 +120,7 @@ public:
}
}
void
operator
()(
error
&
err
)
{
void
operator
()(
error
&
err
)
{
CAF_LOG_TRACE
(
CAF_ARG2
(
"pending"
,
*
pending
));
if
(
*
pending
>
0
)
{
if
(
*
pending
>
0
)
{
*
pending
=
0
;
*
pending
=
0
;
handler
(
err
);
handler
(
err
);
...
@@ -162,6 +166,7 @@ public:
...
@@ -162,6 +166,7 @@ public:
template
<
class
Self
,
class
F
,
class
OnError
>
template
<
class
Self
,
class
F
,
class
OnError
>
void
await
(
Self
*
self
,
F
&&
f
,
OnError
&&
g
)
const
{
void
await
(
Self
*
self
,
F
&&
f
,
OnError
&&
g
)
const
{
CAF_LOG_TRACE
(
CAF_ARG
(
ids_
));
auto
bhvr
=
make_behavior
(
std
::
forward
<
F
>
(
f
),
std
::
forward
<
OnError
>
(
g
));
auto
bhvr
=
make_behavior
(
std
::
forward
<
F
>
(
f
),
std
::
forward
<
OnError
>
(
g
));
for
(
auto
id
:
ids_
)
for
(
auto
id
:
ids_
)
self
->
add_awaited_response_handler
(
id
,
bhvr
);
self
->
add_awaited_response_handler
(
id
,
bhvr
);
...
@@ -169,6 +174,7 @@ public:
...
@@ -169,6 +174,7 @@ public:
template
<
class
Self
,
class
F
,
class
OnError
>
template
<
class
Self
,
class
F
,
class
OnError
>
void
then
(
Self
*
self
,
F
&&
f
,
OnError
&&
g
)
const
{
void
then
(
Self
*
self
,
F
&&
f
,
OnError
&&
g
)
const
{
CAF_LOG_TRACE
(
CAF_ARG
(
ids_
));
auto
bhvr
=
make_behavior
(
std
::
forward
<
F
>
(
f
),
std
::
forward
<
OnError
>
(
g
));
auto
bhvr
=
make_behavior
(
std
::
forward
<
F
>
(
f
),
std
::
forward
<
OnError
>
(
g
));
for
(
auto
id
:
ids_
)
for
(
auto
id
:
ids_
)
self
->
add_multiplexed_response_handler
(
id
,
bhvr
);
self
->
add_multiplexed_response_handler
(
id
,
bhvr
);
...
@@ -176,6 +182,7 @@ public:
...
@@ -176,6 +182,7 @@ public:
template
<
class
Self
,
class
F
,
class
G
>
template
<
class
Self
,
class
F
,
class
G
>
void
receive
(
Self
*
self
,
F
&&
f
,
G
&&
g
)
const
{
void
receive
(
Self
*
self
,
F
&&
f
,
G
&&
g
)
const
{
CAF_LOG_TRACE
(
CAF_ARG
(
ids_
));
using
helper_type
=
detail
::
fan_in_responses_helper_t
<
detail
::
decay_t
<
F
>>
;
using
helper_type
=
detail
::
fan_in_responses_helper_t
<
detail
::
decay_t
<
F
>>
;
helper_type
helper
{
ids_
.
size
(),
std
::
forward
<
F
>
(
f
)};
helper_type
helper
{
ids_
.
size
(),
std
::
forward
<
F
>
(
f
)};
auto
error_handler
=
[
&
](
error
&
err
)
{
auto
error_handler
=
[
&
](
error
&
err
)
{
...
...
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