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
2dfe753e
Commit
2dfe753e
authored
Feb 17, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate remaining `*_send_tuple` functions
parent
889067e5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
212 additions
and
235 deletions
+212
-235
examples/remote_actors/distributed_calculator.cpp
examples/remote_actors/distributed_calculator.cpp
+1
-1
libcaf_core/caf/local_actor.hpp
libcaf_core/caf/local_actor.hpp
+4
-16
libcaf_core/caf/mixin/sync_sender.hpp
libcaf_core/caf/mixin/sync_sender.hpp
+199
-206
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+7
-11
unit_testing/test_sync_send.cpp
unit_testing/test_sync_send.cpp
+1
-1
No files found.
examples/remote_actors/distributed_calculator.cpp
View file @
2dfe753e
...
...
@@ -78,7 +78,7 @@ void client_bhvr(event_based_actor* self, const string& host,
}
}
auto
sync_send_request
=
[
=
](
int
lhs
,
const
char
*
op
,
int
rhs
)
{
self
->
sync_send
_tuple
(
server
,
self
->
last_dequeued
()).
then
(
self
->
sync_send
(
server
,
self
->
last_dequeued
()).
then
(
[
=
](
result_atom
,
int
result
)
{
aout
(
self
)
<<
lhs
<<
" "
<<
op
<<
" "
<<
rhs
<<
" = "
<<
result
<<
endl
;
}
...
...
libcaf_core/caf/local_actor.hpp
View file @
2dfe753e
...
...
@@ -400,11 +400,11 @@ class local_actor : public abstract_actor {
attach
(
attachable_ptr
{
new
functor_attachable
(
std
::
move
(
f
))});
}
// <backward_compatibility version="0.9">
/**************************************************************************
* outdated member functions *
**************************************************************************/
// <backward_compatibility version="0.9">
inline
void
send_tuple
(
message_priority
prio
,
const
channel
&
whom
,
message
what
)
CAF_DEPRECATED
;
...
...
@@ -464,23 +464,11 @@ class local_actor : public abstract_actor {
}
// returns the response ID
message_id
timed_sync_send_tuple_impl
(
message_priority
mp
,
const
actor
&
whom
,
const
duration
&
rel_time
,
message
&&
what
);
message_id
timed_sync_send_impl
(
message_priority
,
const
actor
&
,
const
duration
&
,
message
&&
);
// returns the response ID
message_id
sync_send_tuple_impl
(
message_priority
mp
,
const
actor
&
whom
,
message
&&
what
);
// returns the response ID
template
<
class
...
Rs
,
class
...
Ts
>
message_id
sync_send_tuple_impl
(
message_priority
mp
,
const
typed_actor
<
Rs
...
>&
whom
,
message
&&
msg
)
{
return
sync_send_tuple_impl
(
mp
,
actor
{
whom
.
m_ptr
.
get
()},
std
::
move
(
msg
));
}
message_id
sync_send_impl
(
message_priority
,
const
actor
&
,
message
&&
);
// returns 0 if last_dequeued() is an asynchronous or sync request message,
// a response id generated from the request id otherwise
...
...
libcaf_core/caf/mixin/sync_sender.hpp
View file @
2dfe753e
...
...
@@ -25,6 +25,7 @@
#include "caf/actor.hpp"
#include "caf/message.hpp"
#include "caf/duration.hpp"
#include "caf/actor_cast.hpp"
#include "caf/response_handle.hpp"
#include "caf/message_priority.hpp"
#include "caf/check_typed_input.hpp"
...
...
@@ -32,260 +33,252 @@
namespace
caf
{
namespace
mixin
{
template
<
class
Base
,
class
Subtype
,
class
Response
HandleTag
>
template
<
class
Base
,
class
Subtype
,
class
HandleTag
>
class
sync_sender_impl
:
public
Base
{
public:
using
response_handle_type
=
response_handle
<
Subtype
,
message
,
ResponseHandleTag
>
;
using
response_handle_type
=
response_handle
<
Subtype
,
message
,
HandleTag
>
;
/**************************************************************************
*
sync_send[_tuple](actor, ...)
*
**************************************************************************/
/**************************************************************************
**
*
sync_send(...)
*
**************************************************************************
**
/
/**
* Sends `what` as a synchronous message to `whom`.
* @param dest Receiver of the message.
* @param what Message content as tuple.
* @returns A handle identifying a future to the response of `whom`.
* Sends `{vs...}` as a synchronous message to `dest` with priority `prio`.
* @returns A handle identifying a future-like handle to the response.
* @warning The returned handle is actor specific and the response to the
* sent message cannot be received by another actor.
* @throws std::invalid_argument if `
whom == nullptr
*
sent message cannot be received by another actor.
* @throws std::invalid_argument if `
dest == invalid_actor`
*/
response_handle_type
sync_send_tuple
(
message_priority
prio
,
const
actor
&
dest
,
message
what
)
{
return
{
dptr
()
->
sync_send_tuple_impl
(
prio
,
dest
,
std
::
move
(
what
)),
dptr
()};
}
response_handle_type
sync_send_tuple
(
const
actor
&
dest
,
message
what
)
{
return
sync_send_tuple
(
message_priority
::
normal
,
dest
,
std
::
move
(
what
));
template
<
class
...
Vs
>
response_handle_type
sync_send
(
message_priority
prio
,
const
actor
&
dest
,
Vs
&&
...
vs
)
{
static_assert
(
sizeof
...(
Vs
)
>
0
,
"no message to send"
);
return
{
dptr
()
->
sync_send_impl
(
prio
,
dest
,
make_message
(
std
::
forward
<
Vs
>
(
vs
)...)),
dptr
()};
}
/**
* Sends `{what...}` as a synchronous message to `whom`.
* @param dest Receiver of the message.
* @param what Message elements.
* @returns A handle identifying a future to the response of `whom`.
* Sends `{vs...}` as a synchronous message to `dest`.
* @returns A handle identifying a future-like handle to the response.
* @warning The returned handle is actor specific and the response to the
* sent message cannot be received by another actor.
* @throws std::invalid_argument if `
whom == nullpt
r`
* @throws std::invalid_argument if `
dest == invalid_acto
r`
*/
template
<
class
...
Ts
>
response_handle_type
sync_send
(
message_priority
prio
,
const
actor
&
dest
,
Ts
&&
...
what
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
return
sync_send_tuple
(
prio
,
dest
,
make_message
(
std
::
forward
<
Ts
>
(
what
)...));
template
<
class
...
Vs
>
response_handle_type
sync_send
(
const
actor
&
dest
,
Vs
&&
...
vs
)
{
return
sync_send
(
message_priority
::
normal
,
dest
,
std
::
forward
<
Vs
>
(
vs
)...);
}
template
<
class
...
Ts
>
response_handle_type
sync_send
(
const
actor
&
dest
,
Ts
&&
...
what
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
return
sync_send_tuple
(
message_priority
::
normal
,
dest
,
make_message
(
std
::
forward
<
Ts
>
(
what
)...));
/**
* Sends `{vs...}` as a synchronous message to `dest` with priority `prio`.
* @returns A handle identifying a future-like handle to the response.
* @warning The returned handle is actor specific and the response to the
* sent message cannot be received by another actor.
* @throws std::invalid_argument if `dest == invalid_actor`
*/
template
<
class
...
Rs
,
class
...
Vs
>
response_handle
<
Subtype
,
typename
detail
::
deduce_output_type
<
detail
::
type_list
<
Rs
...
>
,
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Vs
>::
type
>::
type
...
>
>::
type
,
HandleTag
>
sync_send
(
message_priority
prio
,
const
typed_actor
<
Rs
...
>&
dest
,
Vs
&&
...
vs
)
{
static_assert
(
sizeof
...(
Vs
)
>
0
,
"no message to send"
);
using
token
=
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Vs
>::
type
>::
type
...
>
;
token
tk
;
check_typed_input
(
dest
,
tk
);
return
{
dptr
()
->
sync_send_impl
(
prio
,
actor_cast
<
actor
>
(
dest
),
make_message
(
std
::
forward
<
Vs
>
(
vs
)...)),
dptr
()};
}
/**************************************************************************
* timed_sync_send[_tuple](actor, ...) *
**************************************************************************/
response_handle_type
timed_sync_send_tuple
(
message_priority
prio
,
const
actor
&
dest
,
const
duration
&
rtime
,
message
what
)
{
return
{
dptr
()
->
timed_sync_send_tuple_impl
(
prio
,
dest
,
rtime
,
std
::
move
(
what
)),
dptr
()};
/**
* Sends `{vs...}` as a synchronous message to `dest`.
* @returns A handle identifying a future-like handle to the response.
* @warning The returned handle is actor specific and the response to the
* sent message cannot be received by another actor.
* @throws std::invalid_argument if `dest == invalid_actor`
*/
template
<
class
...
Rs
,
class
...
Vs
>
response_handle
<
Subtype
,
typename
detail
::
deduce_output_type
<
detail
::
type_list
<
Rs
...
>
,
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Vs
>::
type
>::
type
...
>
>::
type
,
HandleTag
>
sync_send
(
const
typed_actor
<
Rs
...
>&
dest
,
Vs
&&
...
vs
)
{
return
sync_send
(
message_priority
::
normal
,
dest
,
std
::
forward
<
Vs
>
(
vs
)...);
}
response_handle_type
timed_sync_send_tuple
(
const
actor
&
dest
,
const
duration
&
rtime
,
message
what
)
{
return
{
dptr
()
->
timed_sync_send_tuple_impl
(
message_priority
::
normal
,
dest
,
rtime
,
std
::
move
(
what
)),
dptr
()};
}
/****************************************************************************
* timed_sync_send(...) *
****************************************************************************/
template
<
class
...
Ts
>
response_handle_type
timed_sync_send
(
message_priority
prio
,
const
actor
&
dest
,
const
duration
&
rtime
,
Ts
&&
...
what
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
return
timed_sync_send_tuple
(
prio
,
dest
,
rtime
,
make_message
(
std
::
forward
<
Ts
>
(
what
)...));
/**
* Sends `{vs...}` as a synchronous message to `dest` with priority `prio`
* and relative timeout `rtime`.
* @returns A handle identifying a future-like handle to the response.
* @warning The returned handle is actor specific and the response to the
* sent message cannot be received by another actor.
* @throws std::invalid_argument if `dest == invalid_actor`
*/
template
<
class
...
Vs
>
response_handle_type
timed_sync_send
(
message_priority
prio
,
const
actor
&
dest
,
const
duration
&
rtime
,
Vs
&&
...
vs
)
{
static_assert
(
sizeof
...(
Vs
)
>
0
,
"no message to send"
);
return
{
dptr
()
->
timed_sync_send_impl
(
prio
,
dest
,
rtime
,
make_message
(
std
::
forward
<
Vs
>
(
vs
)...)),
dptr
()};
}
template
<
class
...
Ts
>
response_handle_type
timed_sync_send
(
const
actor
&
dest
,
const
duration
&
rtime
,
Ts
&&
...
what
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
return
timed_sync_send_tuple
(
message_priority
::
normal
,
dest
,
rtime
,
make_message
(
std
::
forward
<
Ts
>
(
what
)...));
/**
* Sends `{vs...}` as a synchronous message to `dest` with
* relative timeout `rtime`.
* @returns A handle identifying a future-like handle to the response.
* @warning The returned handle is actor specific and the response to the
* sent message cannot be received by another actor.
* @throws std::invalid_argument if `dest == invalid_actor`
*/
template
<
class
...
Vs
>
response_handle_type
timed_sync_send
(
const
actor
&
dest
,
const
duration
&
rtime
,
Vs
&&
...
vs
)
{
return
timed_sync_send
(
message_priority
::
normal
,
dest
,
rtime
,
std
::
forward
<
Vs
>
(
vs
)...);
}
/**************************************************************************
* sync_send[_tuple](typed_actor<...>, ...) *
**************************************************************************/
template
<
class
...
Rs
,
class
...
Ts
>
/**
* Sends `{vs...}` as a synchronous message to `dest` with priority `prio`
* and relative timeout `rtime`.
* @returns A handle identifying a future-like handle to the response.
* @warning The returned handle is actor specific and the response to the
* sent message cannot be received by another actor.
* @throws std::invalid_argument if `dest == invalid_actor`
*/
template
<
class
...
Rs
,
class
...
Vs
>
response_handle
<
Subtype
,
typename
detail
::
deduce_output_type
<
detail
::
type_list
<
Rs
...
>
,
detail
::
type_list
<
Ts
...
>
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Vs
>::
type
>::
type
...
>::
type
,
ResponseHandleTag
>
sync_send_tuple
(
message_priority
prio
,
const
typed_actor
<
Rs
...
>&
dest
,
std
::
tuple
<
Ts
...
>
what
)
{
return
sync_send_impl
(
prio
,
dest
,
detail
::
type_list
<
Ts
...
>
{},
message
::
move_from_tuple
(
std
::
move
(
what
)));
}
template
<
class
...
Rs
,
class
...
Ts
>
response_handle
<
Subtype
,
typename
detail
::
deduce_output_type
<
detail
::
type_list
<
Rs
...
>
,
detail
::
type_list
<
Ts
...
>>::
type
,
ResponseHandleTag
>
sync_send_tuple
(
const
typed_actor
<
Rs
...
>&
dest
,
std
::
tuple
<
Ts
...
>
what
)
{
return
sync_send_impl
(
message_priority
::
normal
,
dest
,
detail
::
type_list
<
Ts
...
>
{},
message
::
move_from_tuple
(
std
::
move
(
what
)));
}
template
<
class
...
Rs
,
class
...
Ts
>
response_handle
<
Subtype
,
typename
detail
::
deduce_output_type
<
detail
::
type_list
<
Rs
...
>
,
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Ts
>::
type
>::
type
...
>::
type
,
ResponseHandleTag
>
sync_send
(
message_priority
prio
,
const
typed_actor
<
Rs
...
>&
dest
,
Ts
&&
...
what
)
{
return
sync_send_impl
(
prio
,
dest
,
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Ts
>::
type
>::
type
...
>
{},
make_message
(
std
::
forward
<
Ts
>
(
what
)...));
HandleTag
>
timed_sync_send
(
message_priority
prio
,
const
typed_actor
<
Rs
...
>&
dest
,
const
duration
&
rtime
,
Vs
&&
...
vs
)
{
static_assert
(
sizeof
...(
Vs
)
>
0
,
"no message to send"
);
using
token
=
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Vs
>::
type
>::
type
...
>
;
token
tk
;
check_typed_input
(
dest
,
tk
);
return
{
dptr
()
->
timed_sync_send_impl
(
prio
,
actor_cast
<
actor
>
(
dest
),
rtime
,
make_message
(
std
::
forward
<
Vs
>
(
vs
)...)),
dptr
()};
}
template
<
class
...
Rs
,
class
...
Ts
>
response_handle
<
Subtype
,
typename
detail
::
deduce_output_type
<
detail
::
type_list
<
Rs
...
>
,
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Ts
>::
type
>::
type
...
>>::
type
,
ResponseHandleTag
>
sync_send
(
const
typed_actor
<
Rs
...
>&
dest
,
Ts
&&
...
what
)
{
return
sync_send_impl
(
message_priority
::
normal
,
dest
,
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Ts
>::
type
>::
type
...
>
{},
make_message
(
std
::
forward
<
Ts
>
(
what
)...));
/**
* Sends `{vs...}` as a synchronous message to `dest` with
* relative timeout `rtime`.
* @returns A handle identifying a future-like handle to the response.
* @warning The returned handle is actor specific and the response to the
* sent message cannot be received by another actor.
* @throws std::invalid_argument if `dest == invalid_actor`
*/
template
<
class
...
Rs
,
class
...
Vs
>
response_handle
<
Subtype
,
typename
detail
::
deduce_output_type
<
detail
::
type_list
<
Rs
...
>
,
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Vs
>::
type
>::
type
...
>::
type
,
HandleTag
>
timed_sync_send
(
const
typed_actor
<
Rs
...
>&
dest
,
const
duration
&
rtime
,
Vs
&&
...
vs
)
{
return
timed_sync_send
(
message_priority
::
normal
,
dest
,
rtime
,
std
::
forward
<
Vs
>
(
vs
)...);
}
/**************************************************************************
* timed_sync_send[_tuple](typed_actor<...>, ...) *
**************************************************************************/
// <backward_compatibility version="0.9">
/****************************************************************************
* outdated member functions *
****************************************************************************/
/*
template <class... Rs, class... Ts>
response_handle<
Subtype,
typename detail::deduce_output_type<
detail::type_list<Rs...>,
detail::type_list<Ts...>
>::type,
ResponseHandleTag
>
timed_sync_send_tuple(message_priority prio,
const typed_actor<Rs...>& dest,
const duration& rtime,
cow_tuple<Ts...> what) {
return {dptr()->timed_sync_send_tuple_impl(prio, dest, rtime,
std::move(what)),
dptr()};
}
response_handle_type
sync_send_tuple
(
message_priority
prio
,
const
actor
&
dest
,
message
what
)
CAF_DEPRECATED
;
template <class... Rs, class... Ts>
response_handle<
Subtype,
typename detail::deduce_output_type<
detail::type_list<Rs...>,
detail::type_list<Ts...>
>::type,
ResponseHandleTag
>
timed_sync_send_tuple(const typed_actor<Rs...>& dest,
const duration& rtime,
cow_tuple<Ts...> what) {
return {dptr()->timed_sync_send_tuple_impl(message_priority::normal,
dest, rtime,
std::move(what)),
dptr()};
}
*/
response_handle_type
sync_send_tuple
(
const
actor
&
dest
,
message
what
)
CAF_DEPRECATED
;
template
<
class
...
Rs
,
class
...
Ts
>
response_handle
<
Subtype
,
typename
detail
::
deduce_output_type
<
detail
::
type_list
<
Rs
...
>
,
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Ts
>::
type
>::
type
...
>::
type
,
ResponseHandleTag
>
timed_sync_send
(
message_priority
prio
,
const
typed_actor
<
Rs
...
>&
dest
,
const
duration
&
rtime
,
Ts
&&
...
what
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
return
timed_sync_send_tuple
(
prio
,
dest
,
rtime
,
make_message
(
std
::
forward
<
Ts
>
(
what
)...));
}
response_handle_type
timed_sync_send_tuple
(
message_priority
prio
,
const
actor
&
dest
,
const
duration
&
rtime
,
message
what
)
CAF_DEPRECATED
;
template
<
class
...
Rs
,
class
...
Ts
>
response_handle
<
Subtype
,
typename
detail
::
deduce_output_type
<
detail
::
type_list
<
Rs
...
>
,
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
Ts
>::
type
>::
type
...
>::
type
,
ResponseHandleTag
>
timed_sync_send
(
const
typed_actor
<
Rs
...
>&
dest
,
const
duration
&
rtime
,
Ts
&&
...
what
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"no message to send"
);
return
timed_sync_send_tuple
(
message_priority
::
normal
,
dest
,
rtime
,
make_message
(
std
::
forward
<
Ts
>
(
what
)...));
}
response_handle_type
timed_sync_send_tuple
(
const
actor
&
dest
,
const
duration
&
rtime
,
message
what
)
CAF_DEPRECATED
;
// </backward_compatibility>
private:
template
<
class
...
Rs
,
class
...
Ts
>
response_handle
<
Subtype
,
typename
detail
::
deduce_output_type
<
detail
::
type_list
<
Rs
...
>
,
detail
::
type_list
<
Ts
...
>>::
type
,
ResponseHandleTag
>
sync_send_impl
(
message_priority
prio
,
const
typed_actor
<
Rs
...
>&
dest
,
detail
::
type_list
<
Ts
...
>
token
,
message
&&
what
)
{
check_typed_input
(
dest
,
token
);
return
{
dptr
()
->
sync_send_tuple_impl
(
prio
,
dest
,
std
::
move
(
what
)),
dptr
()};
Subtype
*
dptr
()
{
return
static_cast
<
Subtype
*>
(
this
);
}
inline
Subtype
*
dptr
()
{
return
static_cast
<
Subtype
*>
(
this
);
}
};
template
<
class
ResponseHandleTag
>
class
sync_sender
{
public:
template
<
class
Base
,
class
Subtype
>
using
impl
=
sync_sender_impl
<
Base
,
Subtype
,
ResponseHandleTag
>
;
};
// <backward_compatibility version="0.9">
template
<
class
B
,
class
S
,
class
H
>
typename
sync_sender_impl
<
B
,
S
,
H
>::
response_handle_type
sync_sender_impl
<
B
,
S
,
H
>::
sync_send_tuple
(
message_priority
prio
,
const
actor
&
dest
,
message
what
)
{
return
sync_send
(
prio
,
dest
,
std
::
move
(
what
));
}
template
<
class
B
,
class
S
,
class
H
>
typename
sync_sender_impl
<
B
,
S
,
H
>::
response_handle_type
sync_sender_impl
<
B
,
S
,
H
>::
sync_send_tuple
(
const
actor
&
dest
,
message
what
)
{
return
sync_send
(
message_priority
::
normal
,
dest
,
std
::
move
(
what
));
}
template
<
class
B
,
class
S
,
class
H
>
typename
sync_sender_impl
<
B
,
S
,
H
>::
response_handle_type
sync_sender_impl
<
B
,
S
,
H
>::
timed_sync_send_tuple
(
message_priority
prio
,
const
actor
&
dest
,
const
duration
&
rtime
,
message
msg
)
{
return
timed_sync_send
(
prio
,
dest
,
rtime
,
std
::
move
(
msg
));
}
template
<
class
B
,
class
S
,
class
H
>
typename
sync_sender_impl
<
B
,
S
,
H
>::
response_handle_type
sync_sender_impl
<
B
,
S
,
H
>::
timed_sync_send_tuple
(
const
actor
&
dest
,
const
duration
&
rtime
,
message
msg
)
{
return
timed_sync_send
(
message_priority
::
normal
,
dest
,
rtime
,
std
::
move
(
msg
));
}
// </backward_compatibility>
}
// namespace mixin
}
// namespace caf
...
...
libcaf_core/src/local_actor.cpp
View file @
2dfe753e
...
...
@@ -179,14 +179,12 @@ void local_actor::quit(uint32_t reason) {
}
}
message_id
local_actor
::
timed_sync_send_
tuple_
impl
(
message_priority
mp
,
const
actor
&
dest
,
const
duration
&
rtime
,
message
&&
what
)
{
message_id
local_actor
::
timed_sync_send_impl
(
message_priority
mp
,
const
actor
&
dest
,
const
duration
&
rtime
,
message
&&
what
)
{
if
(
!
dest
)
{
throw
std
::
invalid_argument
(
"cannot send synchronous message "
"to invalid_actor"
);
throw
std
::
invalid_argument
(
"cannot sync_send to invalid_actor"
);
}
auto
nri
=
new_request_id
();
if
(
mp
==
message_priority
::
high
)
{
...
...
@@ -200,13 +198,11 @@ message_id local_actor::timed_sync_send_tuple_impl(message_priority mp,
return
rri
;
}
message_id
local_actor
::
sync_send_
tuple_
impl
(
message_priority
mp
,
message_id
local_actor
::
sync_send_impl
(
message_priority
mp
,
const
actor
&
dest
,
message
&&
what
)
{
if
(
!
dest
)
{
throw
std
::
invalid_argument
(
"cannot send synchronous message "
"to invalid_actor"
);
throw
std
::
invalid_argument
(
"cannot sync_send to invalid_actor"
);
}
auto
nri
=
new_request_id
();
if
(
mp
==
message_priority
::
high
)
{
...
...
unit_testing/test_sync_send.cpp
View file @
2dfe753e
...
...
@@ -158,7 +158,7 @@ class D : public popular_actor {
behavior
make_behavior
()
override
{
return
{
others
()
>>
[
=
]
{
return
sync_send
_tuple
(
buddy
(),
last_dequeued
()).
then
(
return
sync_send
(
buddy
(),
last_dequeued
()).
then
(
others
()
>>
[
=
]()
->
message
{
quit
();
return
last_dequeued
();
...
...
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