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
9625c7fe
Commit
9625c7fe
authored
Mar 18, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing `delayed_send` overloads
parent
53f4dacb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
10 deletions
+42
-10
libcaf_core/caf/local_actor.hpp
libcaf_core/caf/local_actor.hpp
+41
-5
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+1
-5
No files found.
libcaf_core/caf/local_actor.hpp
View file @
9625c7fe
...
...
@@ -207,7 +207,8 @@ class local_actor : public abstract_actor, public resumable {
template
<
class
...
Ts
>
void
delayed_send
(
message_priority
mp
,
const
channel
&
dest
,
const
duration
&
rtime
,
Ts
&&
...
xs
)
{
delayed_send_impl
(
mp
,
dest
,
rtime
,
make_message
(
std
::
forward
<
Ts
>
(
xs
)...));
delayed_send_impl
(
message_id
::
make
(
mp
),
dest
,
rtime
,
make_message
(
std
::
forward
<
Ts
>
(
xs
)...));
}
/**
...
...
@@ -215,10 +216,45 @@ class local_actor : public abstract_actor, public resumable {
*/
template
<
class
...
Ts
>
void
delayed_send
(
const
channel
&
dest
,
const
duration
&
rtime
,
Ts
&&
...
xs
)
{
delayed_send_impl
(
message_
priority
::
normal
,
dest
,
rtime
,
delayed_send_impl
(
message_
id
::
make
()
,
dest
,
rtime
,
make_message
(
std
::
forward
<
Ts
>
(
xs
)...));
}
/**
* Sends `{xs...}` delayed by `rtime` to `dest` using the priority `mp`.
*/
template
<
class
...
Sigs
,
class
...
Ts
>
void
delayed_send
(
message_priority
mp
,
const
typed_actor
<
Sigs
...
>&
dest
,
const
duration
&
rtime
,
Ts
&&
...
xs
)
{
using
token
=
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Ts
>::
type
>::
type
...
>
;
token
tk
;
check_typed_input
(
dest
,
tk
);
delayed_send_impl
(
message_id
::
make
(
mp
),
actor_cast
<
abstract_channel
*>
(
dest
),
rtime
,
make_message
(
std
::
forward
<
Ts
>
(
xs
)...));
}
/**
* Sends `{xs...}` delayed by `rtime` to `dest` using the priority `mp`.
*/
template
<
class
...
Sigs
,
class
...
Ts
>
void
delayed_send
(
const
typed_actor
<
Sigs
...
>&
dest
,
const
duration
&
rtime
,
Ts
&&
...
xs
)
{
using
token
=
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Ts
>::
type
>::
type
...
>
;
token
tk
;
check_typed_input
(
dest
,
tk
);
delayed_send_impl
(
message_id
::
make
(),
actor_cast
<
abstract_channel
*>
(
dest
),
rtime
,
make_message
(
std
::
forward
<
Ts
>
(
xs
)...));
}
/****************************************************************************
* miscellaneous actor operations *
****************************************************************************/
...
...
@@ -626,7 +662,7 @@ class local_actor : public abstract_actor, public resumable {
void
send_impl
(
message_id
mp
,
abstract_channel
*
dest
,
message
what
);
void
delayed_send_impl
(
message_
priority
mid
,
const
channel
&
whom
,
void
delayed_send_impl
(
message_
id
mid
,
const
channel
&
whom
,
const
duration
&
rtime
,
message
data
);
std
::
function
<
void
()
>
m_sync_failure_handler
;
...
...
@@ -655,14 +691,14 @@ inline void local_actor::delayed_send_tuple(message_priority mp,
const
channel
&
whom
,
const
duration
&
rtime
,
message
data
)
{
delayed_send_impl
(
m
p
,
actor_cast
<
abstract_channel
*>
(
whom
),
delayed_send_impl
(
m
essage_id
::
make
(
mp
)
,
actor_cast
<
abstract_channel
*>
(
whom
),
rtime
,
std
::
move
(
data
));
}
inline
void
local_actor
::
delayed_send_tuple
(
const
channel
&
whom
,
const
duration
&
rtime
,
message
data
)
{
delayed_send_impl
(
message_
priority
::
normal
,
delayed_send_impl
(
message_
id
::
make
()
,
actor_cast
<
abstract_channel
*>
(
whom
),
rtime
,
std
::
move
(
data
));
}
...
...
libcaf_core/src/local_actor.cpp
View file @
9625c7fe
...
...
@@ -810,12 +810,8 @@ void local_actor::send_exit(const actor_addr& whom, uint32_t reason) {
exit_msg
{
address
(),
reason
});
}
void
local_actor
::
delayed_send_impl
(
message_
priority
prio
,
const
channel
&
dest
,
void
local_actor
::
delayed_send_impl
(
message_
id
mid
,
const
channel
&
dest
,
const
duration
&
rel_time
,
message
msg
)
{
message_id
mid
;
if
(
prio
==
message_priority
::
high
)
{
mid
=
mid
.
with_high_priority
();
}
auto
sched_cd
=
detail
::
singletons
::
get_scheduling_coordinator
();
sched_cd
->
delayed_send
(
rel_time
,
address
(),
dest
,
mid
,
std
::
move
(
msg
));
}
...
...
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