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
b9ee7c32
Commit
b9ee7c32
authored
Jan 12, 2021
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix minor issues in example code
parent
a6cf6260
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
examples/message_passing/fixed_stack.cpp
examples/message_passing/fixed_stack.cpp
+1
-1
examples/message_passing/promises.cpp
examples/message_passing/promises.cpp
+2
-1
examples/testing/ping_pong.cpp
examples/testing/ping_pong.cpp
+4
-2
No files found.
examples/message_passing/fixed_stack.cpp
View file @
b9ee7c32
...
@@ -43,7 +43,7 @@ bool from_string(caf::string_view in, fixed_stack_errc& out) {
...
@@ -43,7 +43,7 @@ bool from_string(caf::string_view in, fixed_stack_errc& out) {
}
}
bool
from_integer
(
uint8_t
in
,
fixed_stack_errc
&
out
)
{
bool
from_integer
(
uint8_t
in
,
fixed_stack_errc
&
out
)
{
if
(
in
>
0
&&
in
<
1
)
{
if
(
in
>
0
&&
in
<
3
)
{
out
=
static_cast
<
fixed_stack_errc
>
(
in
);
out
=
static_cast
<
fixed_stack_errc
>
(
in
);
return
true
;
return
true
;
}
else
{
}
else
{
...
...
examples/message_passing/promises.cpp
View file @
b9ee7c32
...
@@ -16,7 +16,8 @@ adder_actor::behavior_type server_impl(adder_actor::pointer self,
...
@@ -16,7 +16,8 @@ adder_actor::behavior_type server_impl(adder_actor::pointer self,
[
=
](
add_atom
,
int32_t
y
,
int32_t
z
)
{
[
=
](
add_atom
,
int32_t
y
,
int32_t
z
)
{
auto
rp
=
self
->
make_response_promise
<
int32_t
>
();
auto
rp
=
self
->
make_response_promise
<
int32_t
>
();
self
->
request
(
worker
,
infinite
,
add_atom_v
,
y
,
z
)
self
->
request
(
worker
,
infinite
,
add_atom_v
,
y
,
z
)
.
then
([
rp
](
int32_t
result
)
mutable
{
rp
.
deliver
(
result
);
});
.
then
([
rp
](
int32_t
result
)
mutable
{
rp
.
deliver
(
result
);
},
[
rp
](
error
&
err
)
mutable
{
rp
.
deliver
(
std
::
move
(
err
));
});
return
rp
;
return
rp
;
},
},
};
};
...
...
examples/testing/ping_pong.cpp
View file @
b9ee7c32
...
@@ -13,9 +13,11 @@ namespace {
...
@@ -13,9 +13,11 @@ namespace {
behavior
ping
(
event_based_actor
*
self
,
actor
pong_actor
,
int
n
)
{
behavior
ping
(
event_based_actor
*
self
,
actor
pong_actor
,
int
n
)
{
self
->
send
(
pong_actor
,
ping_atom_v
,
n
);
self
->
send
(
pong_actor
,
ping_atom_v
,
n
);
return
{
return
{
[
=
](
pong_atom
,
int
x
)
{
[
=
](
pong_atom
,
int
x
)
->
result
<
ping_atom
,
int
>
{
if
(
x
>
1
)
if
(
x
>
1
)
self
->
send
(
pong_actor
,
ping_atom_v
,
x
-
1
);
return
{
ping_atom_v
,
x
-
1
};
else
return
{};
},
},
};
};
}
}
...
...
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