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
682b0ee1
Commit
682b0ee1
authored
Apr 03, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed `quit_actor` to `send_exit`
parent
f04d525e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
14 deletions
+17
-14
cppa/cppa.hpp
cppa/cppa.hpp
+7
-4
unit_testing/ping_pong.cpp
unit_testing/ping_pong.cpp
+1
-1
unit_testing/test_spawn.cpp
unit_testing/test_spawn.cpp
+7
-7
unit_testing/test_sync_send.cpp
unit_testing/test_sync_send.cpp
+2
-2
No files found.
cppa/cppa.hpp
View file @
682b0ee1
...
...
@@ -856,12 +856,15 @@ actor_ptr remote_actor(network::io_stream_ptr_pair connection);
void
shutdown
();
// note: implemented in singleton_manager.cpp
/**
* @brief Causes @p whom to quit with @p reason.
* @note Does nothing if <tt>reason == exit_reason::normal</tt>.
* @brief Sends an exit message to @p whom with @p reason.
*
* This function is syntactic sugar for
* <tt>send(whom, atom("EXIT"), reason)</tt>.
* @pre <tt>reason != exit_reason::normal</tt>
*/
inline
void
quit_actor
(
const
actor_ptr
&
whom
,
std
::
uint32_t
reason
)
{
inline
void
send_exit
(
const
actor_ptr
&
whom
,
std
::
uint32_t
reason
)
{
CPPA_REQUIRE
(
reason
!=
exit_reason
::
normal
);
send
(
whom
.
get
()
,
atom
(
"EXIT"
),
reason
);
send
(
whom
,
atom
(
"EXIT"
),
reason
);
}
/**
...
...
unit_testing/ping_pong.cpp
View file @
682b0ee1
...
...
@@ -22,7 +22,7 @@ behavior ping_behavior(size_t num_pings) {
CPPA_LOGF_ERROR_IF
(
!
self
->
last_sender
(),
"last_sender() == nullptr"
);
//cout << to_string(self->last_dequeued()) << endl;
if
(
++
s_pongs
>=
num_pings
)
{
quit_actor
(
self
->
last_sender
(),
exit_reason
::
user_defined
);
send_exit
(
self
->
last_sender
(),
exit_reason
::
user_defined
);
self
->
quit
();
}
else
reply
(
atom
(
"ping"
),
value
);
...
...
unit_testing/test_spawn.cpp
View file @
682b0ee1
...
...
@@ -202,7 +202,7 @@ string behavior_test(actor_ptr et) {
throw
runtime_error
(
testee_name
+
" does not reply"
);
}
);
quit_actor
(
et
,
exit_reason
::
user_defined
);
send_exit
(
et
,
exit_reason
::
user_defined
);
await_all_others_done
();
return
result
;
}
...
...
@@ -309,7 +309,7 @@ int main() {
on
(
"hello mirror"
)
>>
CPPA_CHECKPOINT_CB
(),
others
()
>>
CPPA_UNEXPECTED_MSG_CB
()
);
quit_actor
(
mirror
,
exit_reason
::
user_defined
);
send_exit
(
mirror
,
exit_reason
::
user_defined
);
receive
(
on
(
atom
(
"DOWN"
),
exit_reason
::
user_defined
)
>>
CPPA_CHECKPOINT_CB
(),
others
()
>>
CPPA_UNEXPECTED_MSG_CB
()
...
...
@@ -325,7 +325,7 @@ int main() {
on
(
"hello mirror"
)
>>
CPPA_CHECKPOINT_CB
(),
others
()
>>
CPPA_UNEXPECTED_MSG_CB
()
);
quit_actor
(
mirror
,
exit_reason
::
user_defined
);
send_exit
(
mirror
,
exit_reason
::
user_defined
);
receive
(
on
(
atom
(
"DOWN"
),
exit_reason
::
user_defined
)
>>
CPPA_CHECKPOINT_CB
(),
others
()
>>
CPPA_UNEXPECTED_MSG_CB
()
...
...
@@ -429,7 +429,7 @@ int main() {
CPPA_CHECK
(
values
==
expected
);
}
// terminate st
quit_actor
(
st
,
exit_reason
::
user_defined
);
send_exit
(
st
,
exit_reason
::
user_defined
);
await_all_others_done
();
CPPA_CHECKPOINT
();
...
...
@@ -625,8 +625,8 @@ int main() {
CPPA_CHECK_EQUAL
(
name
,
"bob"
);
}
);
quit_actor
(
a1
,
exit_reason
::
user_defined
);
quit_actor
(
a2
,
exit_reason
::
user_defined
);
send_exit
(
a1
,
exit_reason
::
user_defined
);
send_exit
(
a2
,
exit_reason
::
user_defined
);
await_all_others_done
();
factory
::
event_based
([](
int
*
i
)
{
...
...
@@ -652,7 +652,7 @@ int main() {
}
become
(
others
()
>>
CPPA_UNEXPECTED_MSG_CB
());
});
quit_actor
(
legion
,
exit_reason
::
user_defined
);
send_exit
(
legion
,
exit_reason
::
user_defined
);
await_all_others_done
();
CPPA_CHECKPOINT
();
self
->
trap_exit
(
true
);
...
...
unit_testing/test_sync_send.cpp
View file @
682b0ee1
...
...
@@ -215,7 +215,7 @@ int main() {
.
continue_with
([
&
]
{
continuation_called
=
true
;
});
self
->
exec_behavior_stack
();
CPPA_CHECK_EQUAL
(
continuation_called
,
true
);
quit_actor
(
mirror
,
exit_reason
::
user_defined
);
send_exit
(
mirror
,
exit_reason
::
user_defined
);
await_all_others_done
();
CPPA_CHECKPOINT
();
auto
await_success_message
=
[
&
]
{
...
...
@@ -271,7 +271,7 @@ int main() {
sync_send
(
c
,
atom
(
"gogo"
)).
then
(
CPPA_CHECKPOINT_CB
())
.
continue_with
(
CPPA_CHECKPOINT_CB
());
self
->
exec_behavior_stack
();
quit_actor
(
c
,
exit_reason
::
user_defined
);
send_exit
(
c
,
exit_reason
::
user_defined
);
await_all_others_done
();
CPPA_CHECKPOINT
();
...
...
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