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
ea2f6731
Commit
ea2f6731
authored
Aug 20, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
un-inlined receive_response
parent
d94685c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
cppa/cppa.hpp
cppa/cppa.hpp
+1
-8
src/receive.cpp
src/receive.cpp
+9
-0
No files found.
cppa/cppa.hpp
View file @
ea2f6731
...
...
@@ -505,14 +505,7 @@ inline message_future sync_send(const actor_ptr& whom, Args&&... what) {
* @throws std::logic_error if @p handle is not valid or if the actor
* already received the response for @p handle
*/
inline
sync_recv_helper
receive_response
(
const
message_future
&
handle
)
{
return
{
handle
.
id
(),
[](
behavior
&
bhvr
,
message_id_t
mf
)
{
if
(
!
self
->
awaits
(
mf
))
{
throw
std
::
logic_error
(
"response already received"
);
}
self
->
dequeue_response
(
bhvr
,
mf
);
}};
}
sync_recv_helper
receive_response
(
const
message_future
&
handle
);
/**
* @brief Sends a message to the sender of the last received message.
...
...
src/receive.cpp
View file @
ea2f6731
...
...
@@ -28,6 +28,7 @@
\******************************************************************************/
#include "cppa/cppa.hpp"
#include "cppa/receive.hpp"
namespace
cppa
{
...
...
@@ -56,5 +57,13 @@ void receive_loop(partial_function&& rules) {
receive_loop
(
tmp
);
}
sync_recv_helper
receive_response
(
const
message_future
&
handle
)
{
return
{
handle
.
id
(),
[](
behavior
&
bhvr
,
message_id_t
mf
)
{
if
(
!
self
->
awaits
(
mf
))
{
throw
std
::
logic_error
(
"response already received"
);
}
self
->
dequeue_response
(
bhvr
,
mf
);
}};
}
}
// namespace cppa
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