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
9d24c002
Commit
9d24c002
authored
Jul 08, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dequeue customization point to blocking_actor
parent
b9f677ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
libcaf_core/caf/blocking_actor.hpp
libcaf_core/caf/blocking_actor.hpp
+4
-0
libcaf_core/src/blocking_actor.cpp
libcaf_core/src/blocking_actor.cpp
+5
-1
No files found.
libcaf_core/caf/blocking_actor.hpp
View file @
9d24c002
...
...
@@ -311,6 +311,10 @@ public:
/// the absolute `timeout` was reached.
virtual
bool
await_data
(
timeout_type
timeout
);
/// Returns the next element from the mailbox or `nullptr`.
/// The default implementation simply returns `next_message()`.
virtual
mailbox_element_ptr
dequeue
();
/// @cond PRIVATE
/// Receives messages until either a pre- or postcheck of `rcc` fails.
...
...
libcaf_core/src/blocking_actor.cpp
View file @
9d24c002
...
...
@@ -230,7 +230,7 @@ public:
}
mailbox_element
&
value
()
override
{
ptr_
=
self_
->
next_messag
e
();
ptr_
=
self_
->
dequeu
e
();
CAF_ASSERT
(
ptr_
!=
nullptr
);
return
*
ptr_
;
}
...
...
@@ -390,6 +390,10 @@ bool blocking_actor::await_data(timeout_type timeout) {
return
mailbox
().
synchronized_await
(
mtx_
,
cv_
,
timeout
);
}
mailbox_element_ptr
blocking_actor
::
dequeue
()
{
return
next_message
();
}
size_t
blocking_actor
::
attach_functor
(
const
actor
&
x
)
{
return
attach_functor
(
actor_cast
<
strong_actor_ptr
>
(
x
));
}
...
...
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