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
6048c9b8
Commit
6048c9b8
authored
Apr 19, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timeout handling
parent
a7b756a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
src/abstract_event_based_actor.cpp
src/abstract_event_based_actor.cpp
+19
-5
src/yielding_actor.cpp
src/yielding_actor.cpp
+2
-1
unit_testing/test__spawn.cpp
unit_testing/test__spawn.cpp
+0
-2
No files found.
src/abstract_event_based_actor.cpp
View file @
6048c9b8
...
...
@@ -100,6 +100,13 @@ auto abstract_event_based_actor::handle_message(mailbox_element& node) -> handle
void
abstract_event_based_actor
::
resume
(
util
::
fiber
*
,
scheduler
::
callback
*
cb
)
{
auto
done_cb
=
[
&
]()
{
m_state
.
store
(
abstract_scheduled_actor
::
done
);
m_loop_stack
.
clear
();
on_exit
();
cb
->
exec_done
();
};
self
.
set
(
this
);
try
{
...
...
@@ -137,7 +144,12 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb)
}
case
msg_handled
:
{
// try to match cached messages
if
(
m_loop_stack
.
empty
())
{
done_cb
();
return
;
}
// try to match cached messages before receiving new ones
auto
i
=
m_cache
.
begin
();
while
(
i
!=
m_cache
.
end
()
&&
!
m_loop_stack
.
empty
())
{
...
...
@@ -151,6 +163,11 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb)
case
msg_handled
:
{
m_cache
.
erase
(
i
);
if
(
m_loop_stack
.
empty
())
{
done_cb
();
return
;
}
i
=
m_cache
.
begin
();
break
;
}
...
...
@@ -181,10 +198,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb)
{
cleanup
(
exit_reason
::
unhandled_exception
);
}
m_state
.
store
(
abstract_scheduled_actor
::
done
);
m_loop_stack
.
clear
();
on_exit
();
cb
->
exec_done
();
done_cb
();
}
void
abstract_event_based_actor
::
on_exit
()
...
...
src/yielding_actor.cpp
View file @
6048c9b8
...
...
@@ -109,11 +109,12 @@ void yielding_actor::dequeue(behavior& bhvr)
auto
&
fun
=
bhvr
.
get_partial_function
();
if
(
bhvr
.
timeout
().
valid
()
==
false
)
{
dequeue
(
bhvr
.
get_partial_function
()
);
dequeue
(
fun
);
return
;
}
if
(
m_invoke
.
invoke_from_cache
(
fun
)
==
false
)
{
request_timeout
(
bhvr
.
timeout
());
bool
timeout_occured
=
false
;
for
(;;)
{
...
...
unit_testing/test__spawn.cpp
View file @
6048c9b8
#define CPPA_VERBOSE_CHECK
#include <stack>
#include <chrono>
#include <iostream>
...
...
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