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
87baa353
Commit
87baa353
authored
Apr 29, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate review feedback
parent
606b75da
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
25 deletions
+28
-25
examples/caf-application.ini
examples/caf-application.ini
+11
-8
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+0
-2
libcaf_io/caf/io/basp/instance.hpp
libcaf_io/caf/io/basp/instance.hpp
+2
-2
libcaf_io/src/io/basp/instance.cpp
libcaf_io/src/io/basp/instance.cpp
+1
-1
libcaf_io/src/io/basp_broker.cpp
libcaf_io/src/io/basp_broker.cpp
+14
-12
No files found.
examples/caf-application.ini
View file @
87baa353
...
...
@@ -38,12 +38,19 @@ relaxed-sleep-duration=10ms
; configures whether MMs try to span a full mesh
enable-automatic-connections
=
false
; application identifier of this node, prevents connection to other CAF
; instances with
different identifier
app-identifier
=
""
; instances with
incompatible identifiers (at least one entry must match)
app-identifier
s
=
["generic-caf-app"]
; maximum number of consecutive I/O reads per broker
max-consecutive-reads
=
50
; heartbeat message interval in ms (0 disables heartbeating)
heartbeat-interval
=
0ms
; heartbeat message interval for periodic traffic
; (0 disables heartbeating - not recommended)
heartbeat-interval
=
10s
; force disconnects of CAF nodes after receiving no traffic for this amount of
; time (0 disables this feature - not recommended), be careful when deploying
; CAF applications with different heartbeat intervals and connection timeouts:
; this timeout should lign up with the *longest* heartbeat interval (ideally
; it's a multiple)
connection-timeout
=
30s
; configures whether the MM attaches its internal utility actors to the
; scheduler instead of dedicating individual threads (needed only for
; deterministic testing)
...
...
@@ -52,10 +59,6 @@ attach-utility-actors=false
; setting this to true allows fully deterministic execution in unit test and
; requires the user to trigger I/O manually
manual-multiplexing
=
false
; disables communication via TCP
disable-tcp
=
false
; enable communication via UDP
enable-udp
=
false
; configures how many background workers are spawned for deserialization,
; by default CAF uses 1-4 workers depending on the number of cores
workers
=
<min(3, number of cores / 4) + 1>
...
...
libcaf_core/src/actor_system_config.cpp
View file @
87baa353
...
...
@@ -115,8 +115,6 @@ actor_system_config::actor_system_config()
"excluded components for logging"
)
.
add
<
bool
>
(
"inline-output"
,
"disable logger thread (for testing only!)"
);
opt_group
{
custom_options_
,
"middleman"
}
.
add
<
atom_value
>
(
"network-backend"
,
"either 'default' or 'asio' (if available)"
)
.
add
<
std
::
vector
<
string
>>
(
"app-identifiers"
,
"valid application identifiers of this node"
)
.
add
<
string
>
(
"app-identifier"
,
"DEPRECATED: use app-identifiers instead"
)
...
...
libcaf_io/caf/io/basp/instance.hpp
View file @
87baa353
...
...
@@ -122,8 +122,8 @@ public:
connection_state
handle
(
execution_unit
*
ctx
,
new_data_msg
&
dm
,
header
&
hdr
,
bool
is_payload
);
/// Sends heartbeat messages to all
valid nodes those are directly connected
.
void
handle_heartbeat
(
execution_unit
*
ctx
);
/// Sends heartbeat messages to all
connected nodes
.
void
send_heartbeats
(
execution_unit
*
ctx
);
/// Returns a route to `target` or `none` on error.
optional
<
routing_table
::
route
>
lookup
(
const
node_id
&
target
);
...
...
libcaf_io/src/io/basp/instance.cpp
View file @
87baa353
...
...
@@ -83,7 +83,7 @@ connection_state instance::handle(execution_unit* ctx, new_data_msg& dm,
return
handle
(
ctx
,
dm
.
handle
,
hdr
,
payload
);
}
void
instance
::
handle_heartbeat
(
execution_unit
*
ctx
)
{
void
instance
::
send_heartbeats
(
execution_unit
*
ctx
)
{
CAF_LOG_TRACE
(
""
);
for
(
auto
&
kvp
:
tbl_
.
direct_by_hdl_
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
kvp
.
first
)
<<
CAF_ARG
(
kvp
.
second
));
...
...
libcaf_io/src/io/basp_broker.cpp
View file @
87baa353
...
...
@@ -356,11 +356,12 @@ behavior basp_broker::make_behavior() {
"Interval too low or BASP actor overloaded!"
);
}
// Send out heartbeats.
instance
.
handle_heartbeat
(
context
());
instance
.
send_heartbeats
(
context
());
// Check whether any node reached the disconnect timeout.
if
(
connection_timeout
.
count
()
>
0
)
{
for
(
auto
i
=
ctx
.
begin
();
i
!=
ctx
.
end
();)
{
if
(
i
->
second
.
last_seen
+
connection_timeout
<
now
)
{
CAF_LOG_WARNING
(
"Disconnect BASP node: reached connection timeout!
"
);
CAF_LOG_WARNING
(
"Disconnect BASP node: reached connection timeout
"
);
auto
hdl
=
i
->
second
.
hdl
;
// connection_cleanup below calls ctx.erase, so we need to increase
// the iterator now, before it gets invalidated.
...
...
@@ -371,6 +372,7 @@ behavior basp_broker::make_behavior() {
++
i
;
}
}
}
// Schedule next tick.
scheduled_send
(
this
,
next_tick
,
tick_atom
::
value
,
next_tick
,
heartbeat_interval
,
connection_timeout
);
...
...
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