Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
actor-incubator
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
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-incubator
Commits
b24edf52
Commit
b24edf52
authored
Nov 01, 2019
by
Jakob Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include review feedback
parent
b082dec9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
20 deletions
+19
-20
libcaf_net/caf/net/basp/worker.hpp
libcaf_net/caf/net/basp/worker.hpp
+1
-1
libcaf_net/src/application.cpp
libcaf_net/src/application.cpp
+5
-10
libcaf_net/src/worker.cpp
libcaf_net/src/worker.cpp
+1
-1
libcaf_net/test/net/basp/message_queue.cpp
libcaf_net/test/net/basp/message_queue.cpp
+6
-4
libcaf_net/test/net/basp/worker.cpp
libcaf_net/test/net/basp/worker.cpp
+6
-4
No files found.
libcaf_net/caf/net/basp/worker.hpp
View file @
b24edf52
...
...
@@ -64,7 +64,7 @@ public:
// -- management -------------------------------------------------------------
void
launch
(
const
node_id
&
last_hop
,
const
basp
::
header
&
hdr
,
const
buffer_type
&
payload
);
span
<
const
byte
>
payload
);
// -- implementation of resumable --------------------------------------------
...
...
libcaf_net/src/application.cpp
View file @
b24edf52
...
...
@@ -45,9 +45,7 @@ namespace net {
namespace
basp
{
application
::
application
(
proxy_registry
&
proxies
)
:
proxies_
(
proxies
),
queue_
{
std
::
unique_ptr
<
message_queue
>
{
new
message_queue
}},
hub_
{
std
::
unique_ptr
<
hub_type
>
{
new
hub_type
}}
{
:
proxies_
(
proxies
),
queue_
{
new
message_queue
},
hub_
{
new
hub_type
}
{
// nop
}
...
...
@@ -252,12 +250,9 @@ error application::handle_handshake(packet_writer&, header hdr,
error
application
::
handle_actor_message
(
packet_writer
&
,
header
hdr
,
byte_span
payload
)
{
auto
worker
=
hub_
->
pop
();
// TODO: This copy is nessecary because the worker interface expects a buffer
// type...
buffer_type
buf
(
payload
.
begin
(),
payload
.
end
());
if
(
worker
!=
nullptr
)
{
CAF_LOG_DEBUG
(
"launch BASP worker for deserializing an actor_message"
);
worker
->
launch
(
node_id
{},
hdr
,
buf
);
worker
->
launch
(
node_id
{},
hdr
,
payload
);
}
else
{
CAF_LOG_DEBUG
(
"out of BASP workers, continue deserializing an actor_message"
);
...
...
@@ -266,7 +261,7 @@ error application::handle_actor_message(packet_writer&, header hdr,
struct
handler
:
remote_message_handler
<
handler
>
{
handler
(
message_queue
*
queue
,
proxy_registry
*
proxies
,
actor_system
*
system
,
node_id
last_hop
,
basp
::
header
&
hdr
,
b
uffer_type
&
payload
)
b
yte_span
payload
)
:
queue_
(
queue
),
proxies_
(
proxies
),
system_
(
system
),
...
...
@@ -280,10 +275,10 @@ error application::handle_actor_message(packet_writer&, header hdr,
actor_system
*
system_
;
node_id
last_hop_
;
basp
::
header
&
hdr_
;
b
uffer_type
&
payload_
;
b
yte_span
payload_
;
uint64_t
msg_id_
;
};
handler
f
{
queue_
.
get
(),
&
proxies_
,
system_
,
node_id
{},
hdr
,
buf
};
handler
f
{
queue_
.
get
(),
&
proxies_
,
system_
,
node_id
{},
hdr
,
payload
};
f
.
handle_remote_message
(
&
executor_
);
}
return
none
;
...
...
libcaf_net/src/worker.cpp
View file @
b24edf52
...
...
@@ -42,7 +42,7 @@ worker::~worker() {
// -- management ---------------------------------------------------------------
void
worker
::
launch
(
const
node_id
&
last_hop
,
const
basp
::
header
&
hdr
,
const
buffer_type
&
payload
)
{
span
<
const
byte
>
payload
)
{
msg_id_
=
queue_
->
new_id
();
last_hop_
=
last_hop
;
memcpy
(
&
hdr_
,
&
hdr
,
sizeof
(
basp
::
header
));
...
...
libcaf_net/test/net/basp/message_queue.cpp
View file @
b24edf52
...
...
@@ -16,7 +16,7 @@
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#define CAF_SUITE basp.message_queue
#define CAF_SUITE
net.
basp.message_queue
#include "caf/net/basp/message_queue.hpp"
...
...
@@ -31,9 +31,11 @@ using namespace caf;
namespace
{
behavior
testee_impl
()
{
return
{[](
ok_atom
,
int
)
{
return
{
[](
ok_atom
,
int
)
{
// nop
}};
},
};
}
struct
fixture
:
test_coordinator_fixture
<>
{
...
...
libcaf_net/test/net/basp/worker.cpp
View file @
b24edf52
...
...
@@ -16,7 +16,7 @@
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#define CAF_SUITE basp.worker
#define CAF_SUITE
net.
basp.worker
#include "caf/net/basp/worker.hpp"
...
...
@@ -35,9 +35,11 @@ using namespace caf;
namespace
{
behavior
testee_impl
()
{
return
{[](
ok_atom
)
{
return
{
[](
ok_atom
)
{
// nop
}};
},
};
}
class
mock_actor_proxy
:
public
actor_proxy
{
...
...
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