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
c7aae68e
Commit
c7aae68e
authored
Jul 01, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make await_data customizable by making it virtual
parent
cda62364
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
libcaf_core/caf/blocking_actor.hpp
libcaf_core/caf/blocking_actor.hpp
+7
-5
libcaf_core/caf/detail/blocking_behavior.hpp
libcaf_core/caf/detail/blocking_behavior.hpp
+8
-6
No files found.
libcaf_core/caf/blocking_actor.hpp
View file @
c7aae68e
...
...
@@ -302,14 +302,16 @@ public:
return
fail_state_
;
}
//
/ @cond PRIVATE
//
-- customization points ---------------------------------------------------
/// Blocks until at least one message is in the mailbox.
void
await_data
();
v
irtual
v
oid
await_data
();
/// Blocks until at least one message is in the mailbox or
/// the absolute `timeout` was reached.
bool
await_data
(
timeout_type
timeout
);
virtual
bool
await_data
(
timeout_type
timeout
);
/// @cond PRIVATE
/// Receives messages until either a pre- or postcheck of `rcc` fails.
template
<
class
...
Ts
>
...
...
@@ -325,12 +327,12 @@ public:
is_timeout_or_catch_all
>::
type
;
filtered
tk
;
behavior
bhvr
{
apply_args
(
make_behavior_impl
,
get_indices
(
tk
),
tup
)};
behavior
bhvr
{
apply_
moved_
args
(
make_behavior_impl
,
get_indices
(
tk
),
tup
)};
using
tail_indices
=
typename
il_range
<
tl_size
<
filtered
>::
value
,
sizeof
...(
Ts
)
>::
type
;
make_blocking_behavior_t
factory
;
auto
fun
=
apply_args_prefixed
(
factory
,
tail_indices
{},
tup
,
bhvr
);
auto
fun
=
apply_
moved_
args_prefixed
(
factory
,
tail_indices
{},
tup
,
bhvr
);
receive_impl
(
rcc
,
mid
,
fun
);
}
...
...
libcaf_core/caf/detail/blocking_behavior.hpp
View file @
c7aae68e
...
...
@@ -116,28 +116,30 @@ struct make_blocking_behavior_t {
// nop
}
inline
blocking_behavior
operator
()(
behavior
&
x
)
const
{
inline
blocking_behavior
operator
()(
behavior
x
)
const
{
return
{
std
::
move
(
x
)};
}
template
<
class
F
>
blocking_behavior_v2
<
F
>
operator
()(
behavior
&
x
,
catch_all
<
F
>&
y
)
const
{
blocking_behavior_v2
<
F
>
operator
()(
behavior
x
,
catch_all
<
F
>
y
)
const
{
return
{
std
::
move
(
x
),
std
::
move
(
y
)};
}
template
<
class
F
>
blocking_behavior_v3
<
F
>
operator
()(
behavior
&
x
,
timeout_definition
<
F
>
&
y
)
const
{
blocking_behavior_v3
<
F
>
operator
()(
behavior
x
,
timeout_definition
<
F
>
y
)
const
{
return
{
std
::
move
(
x
),
std
::
move
(
y
)};
}
template
<
class
F1
,
class
F2
>
blocking_behavior_v4
<
F1
,
F2
>
operator
()(
behavior
&
x
,
catch_all
<
F1
>&
y
,
timeout_definition
<
F2
>
&
z
)
const
{
blocking_behavior_v4
<
F1
,
F2
>
operator
()(
behavior
x
,
catch_all
<
F1
>
y
,
timeout_definition
<
F2
>
z
)
const
{
return
{
std
::
move
(
x
),
std
::
move
(
y
),
std
::
move
(
z
)};
}
};
constexpr
make_blocking_behavior_t
make_blocking_behavior
=
make_blocking_behavior_t
{};
}
// namespace detail
}
// namespace caf
...
...
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