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
f582e63c
Commit
f582e63c
authored
Aug 09, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added delayed_send_tuple and delayed_reply_tuple
parent
f30013ae
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
cppa/detail/abstract_scheduled_actor.hpp
cppa/detail/abstract_scheduled_actor.hpp
+4
-2
cppa/scheduler.hpp
cppa/scheduler.hpp
+5
-9
No files found.
cppa/detail/abstract_scheduled_actor.hpp
View file @
f582e63c
...
...
@@ -68,8 +68,10 @@ class abstract_scheduled_actor : public abstract_actor<scheduled_actor> {
++
m_active_timeout_id
));
}
else
{
get_scheduler
()
->
delayed_send
(
this
,
d
,
atom
(
"TIMEOUT"
),
++
m_active_timeout_id
);
get_scheduler
()
->
delayed_send
(
this
,
d
,
make_any_tuple
(
atom
(
"TIMEOUT"
),
++
m_active_timeout_id
));
}
m_has_pending_timeout_request
=
true
;
}
...
...
cppa/scheduler.hpp
View file @
f582e63c
...
...
@@ -116,13 +116,11 @@ class scheduler {
template
<
typename
Duration
,
typename
...
Data
>
void
delayed_send
(
const
channel_ptr
&
to
,
const
Duration
&
rel_time
,
Data
&&
...
data
)
{
static_assert
(
sizeof
...(
Data
)
>
0
,
"no message to send"
);
auto
sub
=
make_any_tuple
(
std
::
forward
<
Data
>
(
data
)...);
any_tuple
data
)
{
auto
tup
=
make_any_tuple
(
atom
(
"SEND"
),
util
::
duration
{
rel_time
},
to
,
std
::
move
(
sub
));
std
::
move
(
data
));
delayed_send_helper
()
->
enqueue
(
self
,
std
::
move
(
tup
));
}
...
...
@@ -130,20 +128,18 @@ class scheduler {
void
delayed_reply
(
const
actor_ptr
&
to
,
const
Duration
&
rel_time
,
message_id_t
id
,
Data
&&
...
data
)
{
static_assert
(
sizeof
...(
Data
)
>
0
,
"no message to send"
);
any_tuple
data
)
{
CPPA_REQUIRE
(
!
id
.
valid
()
||
id
.
is_response
());
if
(
id
.
valid
())
{
auto
sub
=
make_any_tuple
(
std
::
forward
<
Data
>
(
data
)...);
auto
tup
=
make_any_tuple
(
atom
(
"REPLY"
),
util
::
duration
{
rel_time
},
to
,
id
,
std
::
move
(
sub
));
std
::
move
(
data
));
delayed_send_helper
()
->
enqueue
(
self
,
std
::
move
(
tup
));
}
else
{
delayed_send
(
to
,
rel_time
,
id
,
std
::
forward
<
Data
>
(
data
)...
);
this
->
delayed_send
(
to
,
rel_time
,
std
::
move
(
data
)
);
}
}
...
...
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