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
1b579742
Commit
1b579742
authored
Sep 10, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate review feedback
parent
a1a997a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
libcaf_core/caf/mixin/sender.hpp
libcaf_core/caf/mixin/sender.hpp
+9
-3
libcaf_core/caf/send.hpp
libcaf_core/caf/send.hpp
+2
-0
No files found.
libcaf_core/caf/mixin/sender.hpp
View file @
1b579742
...
...
@@ -60,6 +60,7 @@ public:
template
<
message_priority
P
=
message_priority
::
normal
,
class
Dest
=
actor
,
class
...
Ts
>
void
send
(
const
Dest
&
dest
,
Ts
&&
...
xs
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
detail
::
type_list
<
detail
::
strip_and_convert_t
<
Ts
>
...
>
args_token
;
type_check
(
dest
,
args_token
);
if
(
dest
)
...
...
@@ -87,12 +88,14 @@ public:
caf
::
anon_send
(
dest
,
std
::
forward
<
Ts
>
(
xs
)...);
}
/// Sends a message after an absolute timeout.
/// Sends a message at given time point (or immediately if `timeout` has
/// passed already).
template
<
message_priority
P
=
message_priority
::
normal
,
class
Dest
=
actor
,
class
...
Ts
>
detail
::
enable_if_t
<!
std
::
is_same
<
Dest
,
group
>::
value
>
scheduled_send
(
const
Dest
&
dest
,
actor_clock
::
time_point
timeout
,
Ts
&&
...
xs
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
detail
::
type_list
<
detail
::
strip_and_convert_t
<
Ts
>
...
>
args_token
;
type_check
(
dest
,
args_token
);
if
(
dest
)
{
...
...
@@ -104,11 +107,12 @@ public:
}
}
/// Sends a message a
fter an absolute timeout. Sends the message immediately
///
if the timeout has already past
.
/// Sends a message a
t given time point (or immediately if `timeout` has
///
passed already)
.
template
<
class
...
Ts
>
void
scheduled_send
(
const
group
&
dest
,
actor_clock
::
time_point
timeout
,
Ts
&&
...
xs
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
static_assert
(
!
statically_typed
<
Subtype
>
(),
"statically typed actors are not allowed to send to groups"
);
if
(
dest
)
{
...
...
@@ -124,6 +128,7 @@ public:
detail
::
enable_if_t
<!
std
::
is_same
<
Dest
,
group
>::
value
>
delayed_send
(
const
Dest
&
dest
,
std
::
chrono
::
duration
<
Rep
,
Period
>
rel_timeout
,
Ts
&&
...
xs
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
detail
::
type_list
<
detail
::
strip_and_convert_t
<
Ts
>
...
>
args_token
;
type_check
(
dest
,
args_token
);
if
(
dest
)
{
...
...
@@ -141,6 +146,7 @@ public:
class
...
Ts
>
void
delayed_send
(
const
group
&
dest
,
std
::
chrono
::
duration
<
Rep
,
Period
>
rtime
,
Ts
&&
...
xs
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
static_assert
(
!
statically_typed
<
Subtype
>
(),
"statically typed actors are not allowed to send to groups"
);
if
(
dest
)
{
...
...
libcaf_core/caf/send.hpp
View file @
1b579742
...
...
@@ -71,6 +71,7 @@ void send_as(const Source& src, const Dest& dest, Ts&&... xs) {
template
<
message_priority
P
=
message_priority
::
normal
,
class
Source
,
class
Dest
,
class
...
Ts
>
void
unsafe_send_as
(
Source
*
src
,
const
Dest
&
dest
,
Ts
&&
...
xs
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
if
(
dest
)
actor_cast
<
abstract_actor
*>
(
dest
)
->
eq_impl
(
make_message_id
(
P
),
src
->
ctrl
(),
src
->
context
(),
...
...
@@ -81,6 +82,7 @@ template <class... Ts>
void
unsafe_response
(
local_actor
*
self
,
strong_actor_ptr
src
,
std
::
vector
<
strong_actor_ptr
>
stages
,
message_id
mid
,
Ts
&&
...
xs
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
strong_actor_ptr
next
;
if
(
stages
.
empty
())
{
next
=
src
;
...
...
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