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
2131e2cb
Commit
2131e2cb
authored
Jul 07, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop legacy .ini support, scope config parameters
parent
1d4dcede
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
246 additions
and
285 deletions
+246
-285
examples/caf-application.conf
examples/caf-application.conf
+82
-83
libcaf_core/caf/actor_system_config.hpp
libcaf_core/caf/actor_system_config.hpp
+0
-4
libcaf_core/caf/defaults.hpp
libcaf_core/caf/defaults.hpp
+13
-27
libcaf_core/caf/logger.hpp
libcaf_core/caf/logger.hpp
+9
-2
libcaf_core/src/actor_system.cpp
libcaf_core/src/actor_system.cpp
+1
-1
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+40
-62
libcaf_core/src/config_option_set.cpp
libcaf_core/src/config_option_set.cpp
+1
-3
libcaf_core/src/group_manager.cpp
libcaf_core/src/group_manager.cpp
+1
-1
libcaf_core/src/inbound_path.cpp
libcaf_core/src/inbound_path.cpp
+1
-1
libcaf_core/src/logger.cpp
libcaf_core/src/logger.cpp
+47
-51
libcaf_core/src/scheduler/abstract_coordinator.cpp
libcaf_core/src/scheduler/abstract_coordinator.cpp
+3
-2
libcaf_core/test/actor_lifetime.cpp
libcaf_core/test/actor_lifetime.cpp
+1
-1
libcaf_core/test/logger.cpp
libcaf_core/test/logger.cpp
+3
-4
libcaf_core/test/native_streaming_classes.cpp
libcaf_core/test/native_streaming_classes.cpp
+1
-1
libcaf_core/test/thread_hook.cpp
libcaf_core/test/thread_hook.cpp
+2
-2
libcaf_io/src/io/basp/instance.cpp
libcaf_io/src/io/basp/instance.cpp
+5
-3
libcaf_io/src/io/basp_broker.cpp
libcaf_io/src/io/basp_broker.cpp
+3
-3
libcaf_io/src/io/middleman.cpp
libcaf_io/src/io/middleman.cpp
+7
-7
libcaf_io/src/io/middleman_actor.cpp
libcaf_io/src/io/middleman_actor.cpp
+1
-1
libcaf_io/src/io/network/datagram_handler.cpp
libcaf_io/src/io/network/datagram_handler.cpp
+1
-1
libcaf_io/src/io/network/default_multiplexer.cpp
libcaf_io/src/io/network/default_multiplexer.cpp
+2
-2
libcaf_io/src/io/network/stream.cpp
libcaf_io/src/io/network/stream.cpp
+1
-1
libcaf_io/test/io/basp_broker.cpp
libcaf_io/test/io/basp_broker.cpp
+4
-4
libcaf_openssl/src/openssl/manager.cpp
libcaf_openssl/src/openssl/manager.cpp
+1
-1
libcaf_openssl/src/openssl/middleman_actor.cpp
libcaf_openssl/src/openssl/middleman_actor.cpp
+1
-1
libcaf_openssl/test/openssl/authentication.cpp
libcaf_openssl/test/openssl/authentication.cpp
+3
-3
libcaf_openssl/test/openssl/remote_actor.cpp
libcaf_openssl/test/openssl/remote_actor.cpp
+1
-1
libcaf_test/caf/test/dsl.hpp
libcaf_test/caf/test/dsl.hpp
+6
-7
tools/caf-run.cpp
tools/caf-run.cpp
+5
-5
No files found.
examples/caf-application.conf
View file @
2131e2cb
# This file shows all possible parameters with defaults. For some values, CAF
# This file shows all possible parameters with defaults. For some values, CAF
# computes a value at runtime if the configuration does not provide a value. For
# computes a value at runtime if the configuration does not provide a value. For
# example, "scheduler.max-threads" has no hard-coded default and instead adjusts
# example, "caf.scheduler.max-threads" has no hard-coded default and instead
# to the number of cores available.
# adjusts to the number of cores available.
caf
{
# when using the default scheduler
# Parameters selecting a default scheduler.
scheduler
{
scheduler
{
# accepted alternative: "sharing"
# Use the work stealing implementation. Accepted alternative: "sharing".
policy
=
"stealing"
policy
=
"stealing"
# configures whether the scheduler generates profiling output
# Maximum number of messages actors can consume in single run (int64 max).
enable
-
profiling
=
false
max
-
throughput
=
9223372036854775807
# forces a fixed number of threads if set
# # Maximum number of threads for the scheduler. No hardcoded default.
# max-threads=... (detected at runtime)
# max-threads = ... (detected at runtime)
# maximum number of messages actors can consume in one run (int64 max)
}
max
-
throughput
=
9223372036854775807
# Prameters for the work stealing scheduler. Only takes effect if
# measurement resolution in milliseconds (only if profiling is enabled)
# caf.scheduler.policy is set to "stealing".
profiling
-
resolution
=
100
ms
work
-
stealing
{
# output file for profiler data (only if profiling is enabled)
# Number of zero-sleep-interval polling attempts.
profiling
-
output
-
file
=
"/dev/null"
aggressive
-
poll
-
attempts
=
100
}
# Frequency of steal attempts during aggressive polling.
aggressive
-
steal
-
interval
=
10
# when using "stealing" as scheduler policy
# Number of moderately aggressive polling attempts.
work
-
stealing
{
moderate
-
poll
-
attempts
=
500
# number of zero-sleep-interval polling attempts
# Frequency of steal attempts during moderate polling.
aggressive
-
poll
-
attempts
=
100
moderate
-
steal
-
interval
=
5
# frequency of steal attempts during aggressive polling
# Sleep interval between poll attempts.
aggressive
-
steal
-
interval
=
10
moderate
-
sleep
-
duration
=
50
us
# number of moderately aggressive polling attempts
# Frequency of steal attempts during relaxed polling.
moderate
-
poll
-
attempts
=
500
relaxed
-
steal
-
interval
=
1
# frequency of steal attempts during moderate polling
# Sleep interval between poll attempts.
moderate
-
steal
-
interval
=
5
relaxed
-
sleep
-
duration
=
10
ms
# sleep interval between poll attempts
}
moderate
-
sleep
-
duration
=
50
us
# Parameters for the I/O module.
# frequency of steal attempts during relaxed polling
middleman
{
relaxed
-
steal
-
interval
=
1
# Configures whether MMs try to span a full mesh.
# sleep interval between poll attempts
enable
-
automatic
-
connections
=
false
relaxed
-
sleep
-
duration
=
10
ms
# Application identifiers of this node, prevents connection to other CAF
}
# instances with incompatible identifiers.
app
-
identifiers
= [
"generic-caf-app"
]
# when loading io::middleman
# Maximum number of consecutive I/O reads per broker.
middleman
{
max
-
consecutive
-
reads
=
50
# configures whether MMs try to span a full mesh
# Heartbeat message interval in ms (0 disables heartbeating).
enable
-
automatic
-
connections
=
false
heartbeat
-
interval
=
0
ms
# application identifier of this node, prevents connection to other CAF
# Configures whether the MM attaches its internal utility actors to the
# instances with different identifier
# scheduler instead of dedicating individual threads (needed only for
app
-
identifier
=
""
# deterministic testing).
# maximum number of consecutive I/O reads per broker
attach
-
utility
-
actors
=
false
max
-
consecutive
-
reads
=
50
# Configures whether the MM starts a background thread for I/O activity.
# heartbeat message interval in ms (0 disables heartbeating)
# Setting this to true allows fully deterministic execution in unit test and
heartbeat
-
interval
=
0
ms
# requires the user to trigger I/O manually.
# configures whether the MM attaches its internal utility actors to the
manual
-
multiplexing
=
false
# scheduler instead of dedicating individual threads (needed only for
# # Configures how many background workers are spawned for deserialization.
# deterministic testing)
# # No hardcoded default.
attach
-
utility
-
actors
=
false
# workers = ... (detected at runtime)
# configures whether the MM starts a background thread for I/O activity,
}
# setting this to true allows fully deterministic execution in unit test and
# Parameters for logging.
# requires the user to trigger I/O manually
logger
{
manual
-
multiplexing
=
false
# # Note: File logging is disabled unless a 'file' section exists that
# disables communication via TCP
# # contains a setting for 'verbosity'.
disable
-
tcp
=
false
# file {
# enable communication via UDP
# # File name template for output log files.
enable
-
udp
=
false
# path = "actor_log_[PID]_[TIMESTAMP]_[NODE].log"
# configures how many background workers are spawned for deserialization,
# # Format for rendering individual log file entries.
# by default CAF uses 1-4 workers depending on the number of cores
# format = "%r %c %p %a %t %C %M %F:%L %m%n"
# workers=... (detected at runtime)
# # Minimum severity of messages that are written to the log. One of:
}
# # 'quiet', 'error', 'warning', 'info', 'debug', or 'trace'.
# verbosity = "trace"
# when compiling with logging enabled
# # A list of components to exclude in file output.
logger
{
# excluded-components = []
# file name template for output log file files (empty string disables logging)
# }
file
-
name
=
"actor_log_[PID]_[TIMESTAMP]_[NODE].log"
# # Note: Console output is disabled unless a 'console' section exists that
# format for rendering individual log file entries
# # contains a setting for 'verbosity'.
file
-
format
=
"%r %c %p %a %t %C %M %F:%L %m%n"
# console {
# configures the minimum severity of messages that are written to the log file
# # Enabled colored output when writing to a TTY if set to true.
# (quiet|error|warning|info|debug|trace)
# colored = true
file
-
verbosity
=
"trace"
# # Format for printing log lines (implicit newline at the end).
# mode for console log output generation (none|colored|uncolored)
# format = "[%c:%p] %d %m"
console
=
"none"
# # Minimum severity of messages that are written to the console. One of:
# format for printing individual log entries to the console
# # 'quiet', 'error', 'warning', 'info', 'debug', or 'trace'.
console
-
format
=
"%m"
# verbosity = "trace"
# configures the minimum severity of messages that are written to the console
# # A list of components to exclude in console output.
# (quiet|error|warning|info|debug|trace)
# excluded-components = []
console
-
verbosity
=
"trace"
# }
# excludes listed components from logging (list of strings)
}
component
-
blacklist
=[]
}
}
libcaf_core/caf/actor_system_config.hpp
View file @
2131e2cb
...
@@ -326,10 +326,6 @@ private:
...
@@ -326,10 +326,6 @@ private:
actor_system_config
&
set_impl
(
string_view
name
,
config_value
value
);
actor_system_config
&
set_impl
(
string_view
name
,
config_value
value
);
error
extract_config_file_path
(
string_list
&
args
);
error
extract_config_file_path
(
string_list
&
args
);
/// Adjusts the content of the configuration, e.g., for ensuring backwards
/// compatibility with older options.
error
adjust_content
();
};
};
/// Returns all user-provided configuration parameters.
/// Returns all user-provided configuration parameters.
...
...
libcaf_core/caf/defaults.hpp
View file @
2131e2cb
...
@@ -68,33 +68,19 @@ constexpr auto relaxed_sleep_duration = timespan{10'000'000};
...
@@ -68,33 +68,19 @@ constexpr auto relaxed_sleep_duration = timespan{10'000'000};
}
// namespace caf::defaults::work_stealing
}
// namespace caf::defaults::work_stealing
namespace
caf
::
defaults
::
logger
{
namespace
caf
::
defaults
::
logger
::
file
{
constexpr
auto
default_log_level
=
string_view
{
constexpr
auto
format
=
string_view
{
"%r %c %p %a %t %C %M %F:%L %m%n"
};
#if CAF_LOG_LEVEL == CAF_LOG_LEVEL_TRACE
constexpr
auto
path
=
string_view
{
"actor_log_[PID]_[TIMESTAMP]_[NODE].log"
};
"trace"
#elif CAF_LOG_LEVEL == CAF_LOG_LEVEL_DEBUG
}
// namespace caf::defaults::logger::file
"debug"
#elif CAF_LOG_LEVEL == CAF_LOG_LEVEL_INFO
namespace
caf
::
defaults
::
logger
::
console
{
"info"
#elif CAF_LOG_LEVEL == CAF_LOG_LEVEL_WARNING
constexpr
auto
colored
=
true
;
"warning"
constexpr
auto
format
=
string_view
{
"[%c:%p] %d %m"
};
#elif CAF_LOG_LEVEL == CAF_LOG_LEVEL_ERROR
"error"
}
// namespace caf::defaults::logger::console
#else
"quiet"
#endif
};
constexpr
auto
console
=
string_view
{
"none"
};
constexpr
auto
console_format
=
string_view
{
"%m"
};
constexpr
auto
console_verbosity
=
default_log_level
;
constexpr
auto
file_format
=
string_view
{
"%r %c %p %a %t %C %M %F:%L %m%n"
};
constexpr
auto
file_verbosity
=
default_log_level
;
constexpr
auto
file_name
=
string_view
{
"actor_log_[PID]_[TIMESTAMP]_[NODE].log"
};
}
// namespace caf::defaults::logger
namespace
caf
::
defaults
::
middleman
{
namespace
caf
::
defaults
::
middleman
{
...
...
libcaf_core/caf/logger.hpp
View file @
2131e2cb
...
@@ -340,8 +340,15 @@ private:
...
@@ -340,8 +340,15 @@ private:
// Configures verbosity and output generation.
// Configures verbosity and output generation.
config
cfg_
;
config
cfg_
;
// Filters events by component name.
// Filters events by component name before enqueuing a log event. Union of
std
::
vector
<
std
::
string
>
component_blacklist
;
// file_filter_ and console_filter_ if both outputs are enabled.
std
::
vector
<
std
::
string
>
global_filter_
;
// Filters events by component name for file output.
std
::
vector
<
std
::
string
>
file_filter_
;
// Filters events by component name for console output.
std
::
vector
<
std
::
string
>
console_filter_
;
// References the parent system.
// References the parent system.
actor_system
&
system_
;
actor_system
&
system_
;
...
...
libcaf_core/src/actor_system.cpp
View file @
2131e2cb
...
@@ -320,7 +320,7 @@ actor_system::actor_system(actor_system_config& cfg)
...
@@ -320,7 +320,7 @@ actor_system::actor_system(actor_system_config& cfg)
};
};
sched_conf
sc
=
stealing
;
sched_conf
sc
=
stealing
;
namespace
sr
=
defaults
::
scheduler
;
namespace
sr
=
defaults
::
scheduler
;
auto
sr_policy
=
get_or
(
cfg
,
"scheduler.policy"
,
sr
::
policy
);
auto
sr_policy
=
get_or
(
cfg
,
"
caf.
scheduler.policy"
,
sr
::
policy
);
if
(
sr_policy
==
"sharing"
)
if
(
sr_policy
==
"sharing"
)
sc
=
sharing
;
sc
=
sharing
;
else
if
(
sr_policy
==
"testing"
)
else
if
(
sr_policy
==
"testing"
)
...
...
libcaf_core/src/actor_system_config.cpp
View file @
2131e2cb
...
@@ -62,29 +62,30 @@ actor_system_config::actor_system_config()
...
@@ -62,29 +62,30 @@ actor_system_config::actor_system_config()
stream_credit_round_interval
=
defaults
::
stream
::
credit_round_interval
;
stream_credit_round_interval
=
defaults
::
stream
::
credit_round_interval
;
// fill our options vector for creating config file and CLI parsers
// fill our options vector for creating config file and CLI parsers
using
std
::
string
;
using
std
::
string
;
using
string_list
=
std
::
vector
<
string
>
;
opt_group
{
custom_options_
,
"global"
}
opt_group
{
custom_options_
,
"global"
}
.
add
<
bool
>
(
"help,h?"
,
"print help text to STDERR and exit"
)
.
add
<
bool
>
(
"help,h?"
,
"print help text to STDERR and exit"
)
.
add
<
bool
>
(
"long-help"
,
"print long help text to STDERR and exit"
)
.
add
<
bool
>
(
"long-help"
,
"print long help text to STDERR and exit"
)
.
add
<
bool
>
(
"dump-config"
,
"print configuration to STDERR and exit"
)
.
add
<
bool
>
(
"dump-config"
,
"print configuration to STDERR and exit"
)
.
add
<
string
>
(
config_file_path
,
"config-file"
,
.
add
<
string
>
(
config_file_path
,
"config-file"
,
"set config file (default: caf-application.conf)"
);
"set config file (default: caf-application.conf)"
);
opt_group
{
custom_options_
,
"stream"
}
opt_group
{
custom_options_
,
"
caf.
stream"
}
.
add
<
timespan
>
(
stream_desired_batch_complexity
,
"desired-batch-complexity"
,
.
add
<
timespan
>
(
stream_desired_batch_complexity
,
"desired-batch-complexity"
,
"processing time per batch"
)
"processing time per batch"
)
.
add
<
timespan
>
(
stream_max_batch_delay
,
"max-batch-delay"
,
.
add
<
timespan
>
(
stream_max_batch_delay
,
"max-batch-delay"
,
"maximum delay for partial batches"
)
"maximum delay for partial batches"
)
.
add
<
timespan
>
(
stream_credit_round_interval
,
"credit-round-interval"
,
.
add
<
timespan
>
(
stream_credit_round_interval
,
"credit-round-interval"
,
"time between emitting credit"
)
"time between emitting credit"
)
.
add
<
st
d
::
st
ring
>
(
"credit-policy"
,
.
add
<
string
>
(
"credit-policy"
,
"selects an algorithm for credit computation"
);
"selects an algorithm for credit computation"
);
opt_group
{
custom_options_
,
"scheduler"
}
opt_group
{
custom_options_
,
"
caf.
scheduler"
}
.
add
<
st
d
::
st
ring
>
(
"policy"
,
"'stealing' (default) or 'sharing'"
)
.
add
<
string
>
(
"policy"
,
"'stealing' (default) or 'sharing'"
)
.
add
<
size_t
>
(
"max-threads"
,
"maximum number of worker threads"
)
.
add
<
size_t
>
(
"max-threads"
,
"maximum number of worker threads"
)
.
add
<
size_t
>
(
"max-throughput"
,
"nr. of messages actors can consume per run"
)
.
add
<
size_t
>
(
"max-throughput"
,
"nr. of messages actors can consume per run"
)
.
add
<
bool
>
(
"enable-profiling"
,
"enables profiler output"
)
.
add
<
bool
>
(
"enable-profiling"
,
"enables profiler output"
)
.
add
<
timespan
>
(
"profiling-resolution"
,
"data collection rate"
)
.
add
<
timespan
>
(
"profiling-resolution"
,
"data collection rate"
)
.
add
<
string
>
(
"profiling-output-file"
,
"output file for the profiler"
);
.
add
<
string
>
(
"profiling-output-file"
,
"output file for the profiler"
);
opt_group
(
custom_options_
,
"work-stealing"
)
opt_group
(
custom_options_
,
"
caf.
work-stealing"
)
.
add
<
size_t
>
(
"aggressive-poll-attempts"
,
"nr. of aggressive steal attempts"
)
.
add
<
size_t
>
(
"aggressive-poll-attempts"
,
"nr. of aggressive steal attempts"
)
.
add
<
size_t
>
(
"aggressive-steal-interval"
,
.
add
<
size_t
>
(
"aggressive-steal-interval"
,
"frequency of aggressive steal attempts"
)
"frequency of aggressive steal attempts"
)
...
@@ -97,24 +98,23 @@ actor_system_config::actor_system_config()
...
@@ -97,24 +98,23 @@ actor_system_config::actor_system_config()
"frequency of relaxed steal attempts"
)
"frequency of relaxed steal attempts"
)
.
add
<
timespan
>
(
"relaxed-sleep-duration"
,
.
add
<
timespan
>
(
"relaxed-sleep-duration"
,
"sleep duration between relaxed steal attempts"
);
"sleep duration between relaxed steal attempts"
);
opt_group
{
custom_options_
,
"logger"
}
opt_group
{
custom_options_
,
"caf.logger"
}
//
.
add
<
std
::
string
>
(
"verbosity"
,
"default verbosity for file and console"
)
.
add
<
string
>
(
"file-name"
,
"filesystem path of the log file"
)
.
add
<
string
>
(
"file-format"
,
"line format for individual log file entries"
)
.
add
<
std
::
string
>
(
"file-verbosity"
,
"file output verbosity"
)
.
add
<
std
::
string
>
(
"console"
,
"std::clog output: none, colored, or uncolored"
)
.
add
<
string
>
(
"console-format"
,
"line format for printed log entries"
)
.
add
<
std
::
string
>
(
"console-verbosity"
,
"console output verbosity"
)
.
add
<
std
::
vector
<
std
::
string
>>
(
"component-blacklist"
,
"excluded components for logging"
)
.
add
<
bool
>
(
"inline-output"
,
"disable logger thread (for testing only!)"
);
.
add
<
bool
>
(
"inline-output"
,
"disable logger thread (for testing only!)"
);
opt_group
{
custom_options_
,
"middleman"
}
opt_group
{
custom_options_
,
"caf.logger.file"
}
.
add
<
string
>
(
"path"
,
"filesystem path for the log file"
)
.
add
<
string
>
(
"format"
,
"format for individual log file entries"
)
.
add
<
string
>
(
"verbosity"
,
"minimum severity level for file output"
)
.
add
<
string_list
>
(
"excluded-components"
,
"excluded components in files"
);
opt_group
{
custom_options_
,
"caf.logger.console"
}
.
add
<
bool
>
(
"colored"
,
"forces colored or uncolored output"
)
.
add
<
string
>
(
"format"
,
"format for printed console lines"
)
.
add
<
string
>
(
"verbosity"
,
"minimum severity level for console output"
)
.
add
<
string_list
>
(
"excluded-components"
,
"excluded components on console"
);
opt_group
{
custom_options_
,
"caf.middleman"
}
.
add
<
std
::
string
>
(
"network-backend"
,
.
add
<
std
::
string
>
(
"network-backend"
,
"either 'default' or 'asio' (if available)"
)
"either 'default' or 'asio' (if available)"
)
.
add
<
std
::
vector
<
string
>>
(
"app-identifiers"
,
.
add
<
std
::
vector
<
string
>>
(
"app-identifiers"
,
"valid application identifiers of this node"
)
"valid application identifiers of this node"
)
.
add
<
string
>
(
"app-identifier"
,
"DEPRECATED: use app-identifiers instead"
)
.
add
<
bool
>
(
"enable-automatic-connections"
,
.
add
<
bool
>
(
"enable-automatic-connections"
,
"enables automatic connection management"
)
"enables automatic connection management"
)
.
add
<
size_t
>
(
"max-consecutive-reads"
,
.
add
<
size_t
>
(
"max-consecutive-reads"
,
...
@@ -125,7 +125,7 @@ actor_system_config::actor_system_config()
...
@@ -125,7 +125,7 @@ actor_system_config::actor_system_config()
.
add
<
bool
>
(
"manual-multiplexing"
,
.
add
<
bool
>
(
"manual-multiplexing"
,
"disables background activity of the multiplexer"
)
"disables background activity of the multiplexer"
)
.
add
<
size_t
>
(
"workers"
,
"number of deserialization workers"
);
.
add
<
size_t
>
(
"workers"
,
"number of deserialization workers"
);
opt_group
(
custom_options_
,
"openssl"
)
opt_group
(
custom_options_
,
"
caf.
openssl"
)
.
add
<
string
>
(
openssl_certificate
,
"certificate"
,
.
add
<
string
>
(
openssl_certificate
,
"certificate"
,
"path to the PEM-formatted certificate file"
)
"path to the PEM-formatted certificate file"
)
.
add
<
string
>
(
openssl_key
,
"key"
,
.
add
<
string
>
(
openssl_key
,
"key"
,
...
@@ -140,8 +140,9 @@ actor_system_config::actor_system_config()
...
@@ -140,8 +140,9 @@ actor_system_config::actor_system_config()
settings
actor_system_config
::
dump_content
()
const
{
settings
actor_system_config
::
dump_content
()
const
{
settings
result
=
content
;
settings
result
=
content
;
auto
&
caf_group
=
result
[
"caf"
].
as_dictionary
();
// -- streaming parameters
// -- streaming parameters
auto
&
stream_group
=
result
[
"stream"
].
as_dictionary
();
auto
&
stream_group
=
caf_group
[
"stream"
].
as_dictionary
();
put_missing
(
stream_group
,
"desired-batch-complexity"
,
put_missing
(
stream_group
,
"desired-batch-complexity"
,
defaults
::
stream
::
desired_batch_complexity
);
defaults
::
stream
::
desired_batch_complexity
);
put_missing
(
stream_group
,
"max-batch-delay"
,
put_missing
(
stream_group
,
"max-batch-delay"
,
...
@@ -154,7 +155,7 @@ settings actor_system_config::dump_content() const {
...
@@ -154,7 +155,7 @@ settings actor_system_config::dump_content() const {
put_missing
(
stream_group
,
"size-policy.bytes-per-batch"
,
put_missing
(
stream_group
,
"size-policy.bytes-per-batch"
,
defaults
::
stream
::
size_policy
::
bytes_per_batch
);
defaults
::
stream
::
size_policy
::
bytes_per_batch
);
// -- scheduler parameters
// -- scheduler parameters
auto
&
scheduler_group
=
result
[
"scheduler"
].
as_dictionary
();
auto
&
scheduler_group
=
caf_group
[
"scheduler"
].
as_dictionary
();
put_missing
(
scheduler_group
,
"policy"
,
defaults
::
scheduler
::
policy
);
put_missing
(
scheduler_group
,
"policy"
,
defaults
::
scheduler
::
policy
);
put_missing
(
scheduler_group
,
"max-throughput"
,
put_missing
(
scheduler_group
,
"max-throughput"
,
defaults
::
scheduler
::
max_throughput
);
defaults
::
scheduler
::
max_throughput
);
...
@@ -163,7 +164,7 @@ settings actor_system_config::dump_content() const {
...
@@ -163,7 +164,7 @@ settings actor_system_config::dump_content() const {
defaults
::
scheduler
::
profiling_resolution
);
defaults
::
scheduler
::
profiling_resolution
);
put_missing
(
scheduler_group
,
"profiling-output-file"
,
std
::
string
{});
put_missing
(
scheduler_group
,
"profiling-output-file"
,
std
::
string
{});
// -- work-stealing parameters
// -- work-stealing parameters
auto
&
work_stealing_group
=
result
[
"work-stealing"
].
as_dictionary
();
auto
&
work_stealing_group
=
caf_group
[
"work-stealing"
].
as_dictionary
();
put_missing
(
work_stealing_group
,
"aggressive-poll-attempts"
,
put_missing
(
work_stealing_group
,
"aggressive-poll-attempts"
,
defaults
::
work_stealing
::
aggressive_poll_attempts
);
defaults
::
work_stealing
::
aggressive_poll_attempts
);
put_missing
(
work_stealing_group
,
"aggressive-steal-interval"
,
put_missing
(
work_stealing_group
,
"aggressive-steal-interval"
,
...
@@ -179,18 +180,18 @@ settings actor_system_config::dump_content() const {
...
@@ -179,18 +180,18 @@ settings actor_system_config::dump_content() const {
put_missing
(
work_stealing_group
,
"relaxed-sleep-duration"
,
put_missing
(
work_stealing_group
,
"relaxed-sleep-duration"
,
defaults
::
work_stealing
::
relaxed_sleep_duration
);
defaults
::
work_stealing
::
relaxed_sleep_duration
);
// -- logger parameters
// -- logger parameters
auto
&
logger_group
=
result
[
"logger"
].
as_dictionary
();
auto
&
logger_group
=
caf_group
[
"logger"
].
as_dictionary
();
put_missing
(
logger_group
,
"file-name"
,
defaults
::
logger
::
file_name
);
put_missing
(
logger_group
,
"file-format"
,
defaults
::
logger
::
file_format
);
put_missing
(
logger_group
,
"file-verbosity"
,
defaults
::
logger
::
file_verbosity
);
put_missing
(
logger_group
,
"console"
,
defaults
::
logger
::
console
);
put_missing
(
logger_group
,
"console-format"
,
defaults
::
logger
::
console_format
);
put_missing
(
logger_group
,
"console-verbosity"
,
defaults
::
logger
::
console_verbosity
);
put_missing
(
logger_group
,
"component-blacklist"
,
std
::
vector
<
std
::
string
>
{});
put_missing
(
logger_group
,
"inline-output"
,
false
);
put_missing
(
logger_group
,
"inline-output"
,
false
);
auto
&
file_group
=
logger_group
[
"file"
].
as_dictionary
();
put_missing
(
file_group
,
"path"
,
defaults
::
logger
::
file
::
path
);
put_missing
(
file_group
,
"format"
,
defaults
::
logger
::
file
::
format
);
put_missing
(
file_group
,
"excluded-components"
,
std
::
vector
<
std
::
string
>
{});
auto
&
console_group
=
logger_group
[
"console"
].
as_dictionary
();
put_missing
(
console_group
,
"colored"
,
defaults
::
logger
::
console
::
colored
);
put_missing
(
console_group
,
"format"
,
defaults
::
logger
::
console
::
format
);
put_missing
(
console_group
,
"excluded-components"
,
std
::
vector
<
std
::
string
>
{});
// -- middleman parameters
// -- middleman parameters
auto
&
middleman_group
=
result
[
"middleman"
].
as_dictionary
();
auto
&
middleman_group
=
caf_group
[
"middleman"
].
as_dictionary
();
auto
default_id
=
to_string
(
defaults
::
middleman
::
app_identifier
);
auto
default_id
=
to_string
(
defaults
::
middleman
::
app_identifier
);
put_missing
(
middleman_group
,
"app-identifiers"
,
put_missing
(
middleman_group
,
"app-identifiers"
,
std
::
vector
<
std
::
string
>
{
std
::
move
(
default_id
)});
std
::
vector
<
std
::
string
>
{
std
::
move
(
default_id
)});
...
@@ -200,7 +201,7 @@ settings actor_system_config::dump_content() const {
...
@@ -200,7 +201,7 @@ settings actor_system_config::dump_content() const {
put_missing
(
middleman_group
,
"heartbeat-interval"
,
put_missing
(
middleman_group
,
"heartbeat-interval"
,
defaults
::
middleman
::
heartbeat_interval
);
defaults
::
middleman
::
heartbeat_interval
);
// -- openssl parameters
// -- openssl parameters
auto
&
openssl_group
=
result
[
"openssl"
].
as_dictionary
();
auto
&
openssl_group
=
caf_group
[
"openssl"
].
as_dictionary
();
put_missing
(
openssl_group
,
"certificate"
,
std
::
string
{});
put_missing
(
openssl_group
,
"certificate"
,
std
::
string
{});
put_missing
(
openssl_group
,
"key"
,
std
::
string
{});
put_missing
(
openssl_group
,
"key"
,
std
::
string
{});
put_missing
(
openssl_group
,
"passphrase"
,
std
::
string
{});
put_missing
(
openssl_group
,
"passphrase"
,
std
::
string
{});
...
@@ -334,7 +335,7 @@ error actor_system_config::parse(string_list args, std::istream& config) {
...
@@ -334,7 +335,7 @@ error actor_system_config::parse(string_list args, std::istream& config) {
std
::
cout
<<
std
::
flush
;
std
::
cout
<<
std
::
flush
;
cli_helptext_printed
=
true
;
cli_helptext_printed
=
true
;
}
}
return
adjust_content
()
;
return
none
;
}
}
error
actor_system_config
::
parse
(
string_list
args
,
error
actor_system_config
::
parse
(
string_list
args
,
...
@@ -361,11 +362,6 @@ actor_system_config& actor_system_config::add_actor_factory(std::string name,
...
@@ -361,11 +362,6 @@ actor_system_config& actor_system_config::add_actor_factory(std::string name,
actor_system_config
&
actor_system_config
::
set_impl
(
string_view
name
,
actor_system_config
&
actor_system_config
::
set_impl
(
string_view
name
,
config_value
value
)
{
config_value
value
)
{
if
(
name
==
"middleman.app-identifier"
)
{
// TODO: Print a warning with 0.18 and remove this code with 0.19.
value
.
convert_to_list
();
return
set_impl
(
"middleman.app-identifiers"
,
std
::
move
(
value
));
}
auto
opt
=
custom_options_
.
qualified_name_lookup
(
name
);
auto
opt
=
custom_options_
.
qualified_name_lookup
(
name
);
if
(
opt
==
nullptr
)
{
if
(
opt
==
nullptr
)
{
std
::
cerr
<<
"*** failed to set config parameter "
<<
name
std
::
cerr
<<
"*** failed to set config parameter "
<<
name
...
@@ -376,9 +372,10 @@ actor_system_config& actor_system_config::set_impl(string_view name,
...
@@ -376,9 +372,10 @@ actor_system_config& actor_system_config::set_impl(string_view name,
}
else
{
}
else
{
opt
->
store
(
value
);
opt
->
store
(
value
);
auto
category
=
opt
->
category
();
auto
category
=
opt
->
category
();
auto
&
dict
=
category
==
"global"
?
content
if
(
category
==
"global"
)
:
content
[
category
].
as_dictionary
();
content
[
opt
->
long_name
()]
=
std
::
move
(
value
);
dict
[
opt
->
long_name
()]
=
std
::
move
(
value
);
else
put
(
content
,
name
,
std
::
move
(
value
));
}
}
return
*
this
;
return
*
this
;
}
}
...
@@ -455,25 +452,6 @@ error actor_system_config::extract_config_file_path(string_list& args) {
...
@@ -455,25 +452,6 @@ error actor_system_config::extract_config_file_path(string_list& args) {
return
none
;
return
none
;
}
}
error
actor_system_config
::
adjust_content
()
{
// TODO: Print a warning to STDERR if 'app-identifier' is present with 0.18
// and remove this code with 0.19.
auto
i
=
content
.
find
(
"middleman"
);
if
(
i
!=
content
.
end
())
{
if
(
auto
mm
=
get_if
<
settings
>
(
&
i
->
second
))
{
auto
j
=
mm
->
find
(
"app-identifier"
);
if
(
j
!=
mm
->
end
())
{
if
(
!
mm
->
contains
(
"app-identifiers"
))
{
j
->
second
.
convert_to_list
();
mm
->
emplace
(
"app-identifiers"
,
std
::
move
(
j
->
second
));
}
mm
->
container
().
erase
(
j
);
}
}
}
return
none
;
}
const
settings
&
content
(
const
actor_system_config
&
cfg
)
{
const
settings
&
content
(
const
actor_system_config
&
cfg
)
{
return
cfg
.
content
;
return
cfg
.
content
;
}
}
...
...
libcaf_core/src/config_option_set.cpp
View file @
2131e2cb
...
@@ -236,9 +236,7 @@ config_option_set::parse(settings& config,
...
@@ -236,9 +236,7 @@ config_option_set::parse(settings& config,
}
}
config_option_set
::
option_pointer
config_option_set
::
option_pointer
config_option_set
::
cli_long_name_lookup
(
string_view
input
)
const
{
config_option_set
::
cli_long_name_lookup
(
string_view
name
)
const
{
// We accept "caf#" prefixes for backward compatibility, but ignore them.
auto
name
=
input
.
substr
(
input
.
compare
(
0
,
4
,
"caf#"
)
!=
0
?
0u
:
4u
);
// Extract category and long name.
// Extract category and long name.
string_view
category
;
string_view
category
;
string_view
long_name
;
string_view
long_name
;
...
...
libcaf_core/src/group_manager.cpp
View file @
2131e2cb
...
@@ -55,7 +55,7 @@ void await_all_locals_down(actor_system& sys, std::initializer_list<actor> xs) {
...
@@ -55,7 +55,7 @@ void await_all_locals_down(actor_system& sys, std::initializer_list<actor> xs) {
ys
.
push_back
(
x
);
ys
.
push_back
(
x
);
}
}
// Don't block when using the test coordinator.
// Don't block when using the test coordinator.
if
(
auto
policy
=
get_if
<
std
::
string
>
(
&
sys
.
config
(),
"scheduler.policy"
);
if
(
auto
policy
=
get_if
<
std
::
string
>
(
&
sys
.
config
(),
"
caf.
scheduler.policy"
);
policy
&&
*
policy
!=
"testing"
)
policy
&&
*
policy
!=
"testing"
)
self
->
wait_for
(
ys
);
self
->
wait_for
(
ys
);
}
}
...
...
libcaf_core/src/inbound_path.cpp
View file @
2131e2cb
...
@@ -78,7 +78,7 @@ inbound_path::inbound_path(stream_manager_ptr mgr_ptr, stream_slots id,
...
@@ -78,7 +78,7 @@ inbound_path::inbound_path(stream_manager_ptr mgr_ptr, stream_slots id,
<<
detail
::
global_meta_object
(
in_type
)
->
type_name
<<
detail
::
global_meta_object
(
in_type
)
->
type_name
<<
"at slot"
<<
id
.
receiver
<<
"from"
<<
hdl
);
<<
"at slot"
<<
id
.
receiver
<<
"from"
<<
hdl
);
if
(
auto
str
=
get_if
<
std
::
string
>
(
&
self
()
->
system
().
config
(),
if
(
auto
str
=
get_if
<
std
::
string
>
(
&
self
()
->
system
().
config
(),
"stream.credit-policy"
))
{
"
caf.
stream.credit-policy"
))
{
if
(
*
str
==
"testing"
)
if
(
*
str
==
"testing"
)
controller_
.
reset
(
new
detail
::
test_credit_controller
(
self
()));
controller_
.
reset
(
new
detail
::
test_credit_controller
(
self
()));
else
if
(
*
str
==
"size"
)
else
if
(
*
str
==
"size"
)
...
...
libcaf_core/src/logger.cpp
View file @
2131e2cb
...
@@ -283,7 +283,7 @@ logger* logger::current_logger() {
...
@@ -283,7 +283,7 @@ logger* logger::current_logger() {
bool
logger
::
accepts
(
unsigned
level
,
string_view
cname
)
{
bool
logger
::
accepts
(
unsigned
level
,
string_view
cname
)
{
if
(
level
>
cfg_
.
verbosity
)
if
(
level
>
cfg_
.
verbosity
)
return
false
;
return
false
;
return
!
std
::
any_of
(
component_blacklist
.
begin
(),
component_blacklist
.
end
(),
return
std
::
none_of
(
global_filter_
.
begin
(),
global_filter_
.
end
(),
[
=
](
string_view
name
)
{
return
name
==
cname
;
});
[
=
](
string_view
name
)
{
return
name
==
cname
;
});
}
}
...
@@ -302,51 +302,48 @@ logger::~logger() {
...
@@ -302,51 +302,48 @@ logger::~logger() {
void
logger
::
init
(
actor_system_config
&
cfg
)
{
void
logger
::
init
(
actor_system_config
&
cfg
)
{
CAF_IGNORE_UNUSED
(
cfg
);
CAF_IGNORE_UNUSED
(
cfg
);
namespace
lg
=
defaults
::
logger
;
namespace
lg
=
defaults
::
logger
;
using
std
::
string
;
using
string_list
=
std
::
vector
<
std
::
string
>
;
using
string_list
=
std
::
vector
<
std
::
string
>
;
auto
blacklist
=
get_if
<
string_list
>
(
&
cfg
,
"logger.component-blacklist"
);
auto
get_verbosity
=
[
&
cfg
](
string_view
key
)
->
unsigned
{
if
(
blacklist
)
if
(
auto
str
=
get_if
<
string
>
(
&
cfg
,
key
))
component_blacklist
=
move_if_optional
(
blacklist
);
return
to_level_int
(
*
str
);
// Parse the configured log level. We only store a string_view to the
return
CAF_LOG_LEVEL_QUIET
;
// verbosity levels, so we make sure we actually get a string pointer here
};
// (and not an optional<string>).
auto
read_filter
=
[
&
cfg
](
string_list
&
var
,
string_view
key
)
{
const
std
::
string
*
verbosity
=
get_if
<
std
::
string
>
(
&
cfg
,
"logger.verbosity"
);
if
(
auto
lst
=
get_if
<
string_list
>
(
&
cfg
,
key
))
auto
set_level
=
[
&
](
auto
&
var
,
auto
var_default
,
string_view
var_key
)
{
var
=
std
::
move
(
*
lst
);
// User-provided overrides have the highest priority.
if
(
const
std
::
string
*
var_override
=
get_if
<
std
::
string
>
(
&
cfg
,
var_key
))
{
var
=
*
var_override
;
return
;
}
// If present, "logger.verbosity" overrides the defaults for both file and
// console verbosity level.
if
(
verbosity
)
{
var
=
*
verbosity
;
return
;
}
var
=
var_default
;
};
};
string_view
file_str
;
cfg_
.
file_verbosity
=
get_verbosity
(
"caf.logger.file.verbosity"
);
string_view
console_str
;
cfg_
.
console_verbosity
=
get_verbosity
(
"caf.logger.console.verbosity"
);
set_level
(
file_str
,
lg
::
file_verbosity
,
"logger.file-verbosity"
);
set_level
(
console_str
,
lg
::
console_verbosity
,
"logger.console-verbosity"
);
cfg_
.
file_verbosity
=
to_level_int
(
file_str
);
cfg_
.
console_verbosity
=
to_level_int
(
console_str
);
cfg_
.
verbosity
=
std
::
max
(
cfg_
.
file_verbosity
,
cfg_
.
console_verbosity
);
cfg_
.
verbosity
=
std
::
max
(
cfg_
.
file_verbosity
,
cfg_
.
console_verbosity
);
if
(
cfg_
.
verbosity
==
CAF_LOG_LEVEL_QUIET
)
return
;
if
(
cfg_
.
file_verbosity
>
CAF_LOG_LEVEL_QUIET
&&
cfg_
.
console_verbosity
>
CAF_LOG_LEVEL_QUIET
)
{
read_filter
(
file_filter_
,
"caf.logger.file.excluded-components"
);
read_filter
(
console_filter_
,
"caf.logger.console.excluded-components"
);
std
::
sort
(
file_filter_
.
begin
(),
file_filter_
.
end
());
std
::
sort
(
console_filter_
.
begin
(),
console_filter_
.
end
());
std
::
set_union
(
file_filter_
.
begin
(),
file_filter_
.
end
(),
console_filter_
.
begin
(),
console_filter_
.
end
(),
std
::
back_inserter
(
global_filter_
));
}
else
if
(
cfg_
.
file_verbosity
>
CAF_LOG_LEVEL_QUIET
)
{
read_filter
(
file_filter_
,
"caf.logger.file.excluded-components"
);
global_filter_
=
file_filter_
;
}
else
{
read_filter
(
console_filter_
,
"caf.logger.console.excluded-components"
);
global_filter_
=
console_filter_
;
}
// Parse the format string.
// Parse the format string.
file_format_
=
file_format_
parse_format
(
get_or
(
cfg
,
"logger.file-format"
,
lg
::
file_
format
));
=
parse_format
(
get_or
(
cfg
,
"caf.logger.file.format"
,
lg
::
file
::
format
));
console_format_
=
parse_format
(
get_or
(
cfg
,
"logger.console-format"
,
console_format_
=
parse_format
(
lg
::
console_
format
));
get_or
(
cfg
,
"caf.logger.console.format"
,
lg
::
console
::
format
));
// Set flags.
// Set flags.
if
(
get_or
(
cfg
,
"logger.inline-output"
,
false
))
if
(
get_or
(
cfg
,
"
caf.
logger.inline-output"
,
false
))
cfg_
.
inline_output
=
true
;
cfg_
.
inline_output
=
true
;
auto
con
=
get_or
(
cfg
,
"logger.console"
,
lg
::
console
);
// If not set to `false`, CAF enables colored output when writing to TTYs.
if
(
con
==
"colored"
)
{
cfg_
.
console_coloring
=
get_or
(
cfg
,
"caf.logger.console.colored"
,
true
);
cfg_
.
console_coloring
=
true
;
}
else
if
(
con
!=
"uncolored"
)
{
// Disable console output if neither 'colored' nor 'uncolored' are present.
cfg_
.
console_verbosity
=
CAF_LOG_LEVEL_QUIET
;
cfg_
.
verbosity
=
cfg_
.
file_verbosity
;
}
}
}
bool
logger
::
open_file
()
{
bool
logger
::
open_file
()
{
...
@@ -572,21 +569,20 @@ void logger::handle_event(const event& x) {
...
@@ -572,21 +569,20 @@ void logger::handle_event(const event& x) {
void
logger
::
log_first_line
()
{
void
logger
::
log_first_line
()
{
auto
e
=
CAF_LOG_MAKE_EVENT
(
0
,
CAF_LOG_COMPONENT
,
CAF_LOG_LEVEL_DEBUG
,
""
);
auto
e
=
CAF_LOG_MAKE_EVENT
(
0
,
CAF_LOG_COMPONENT
,
CAF_LOG_LEVEL_DEBUG
,
""
);
auto
make_message
=
[
&
](
string_view
config_name
,
std
::
string
default_value
)
{
auto
make_message
=
[
&
](
int
level
,
const
auto
&
filter
)
{
std
::
string
msg
=
"level = "
;
auto
lvl_str
=
log_level_name
[
level
];
msg
+=
get_or
(
system_
.
config
(),
config_name
,
default_value
);
std
::
string
msg
=
"verbosity = "
;
msg
.
insert
(
msg
.
end
(),
lvl_str
.
begin
(),
lvl_str
.
end
());
msg
+=
", node = "
;
msg
+=
", node = "
;
msg
+=
to_string
(
system_
.
node
());
msg
+=
to_string
(
system_
.
node
());
msg
+=
",
component-blacklist
= "
;
msg
+=
",
excluded-components
= "
;
msg
+=
deep_to_string
(
component_blacklist
);
msg
+=
deep_to_string
(
filter
);
return
msg
;
return
msg
;
};
};
namespace
lg
=
defaults
::
logger
;
namespace
lg
=
defaults
::
logger
;
e
.
message
=
make_message
(
"logger.file-verbosity"
,
e
.
message
=
make_message
(
cfg_
.
file_verbosity
,
file_filter_
);
to_string
(
lg
::
file_verbosity
));
handle_file_event
(
e
);
handle_file_event
(
e
);
e
.
message
=
make_message
(
"logger.console-verbosity"
,
e
.
message
=
make_message
(
cfg_
.
console_verbosity
,
console_filter_
);
to_string
(
lg
::
console_verbosity
));
handle_console_event
(
e
);
handle_console_event
(
e
);
}
}
...
@@ -599,8 +595,8 @@ void logger::start() {
...
@@ -599,8 +595,8 @@ void logger::start() {
parent_thread_
=
std
::
this_thread
::
get_id
();
parent_thread_
=
std
::
this_thread
::
get_id
();
if
(
verbosity
()
==
CAF_LOG_LEVEL_QUIET
)
if
(
verbosity
()
==
CAF_LOG_LEVEL_QUIET
)
return
;
return
;
file_name_
=
get_or
(
system_
.
config
(),
"
logger.file-name
"
,
file_name_
=
get_or
(
system_
.
config
(),
"
caf.logger.file.path
"
,
defaults
::
logger
::
file_name
);
defaults
::
logger
::
file
::
path
);
if
(
file_name_
.
empty
())
{
if
(
file_name_
.
empty
())
{
// No need to continue if console and log file are disabled.
// No need to continue if console and log file are disabled.
if
(
console_verbosity
()
==
CAF_LOG_LEVEL_QUIET
)
if
(
console_verbosity
()
==
CAF_LOG_LEVEL_QUIET
)
...
...
libcaf_core/src/scheduler/abstract_coordinator.cpp
View file @
2131e2cb
...
@@ -247,8 +247,9 @@ void abstract_coordinator::start() {
...
@@ -247,8 +247,9 @@ void abstract_coordinator::start() {
void
abstract_coordinator
::
init
(
actor_system_config
&
cfg
)
{
void
abstract_coordinator
::
init
(
actor_system_config
&
cfg
)
{
namespace
sr
=
defaults
::
scheduler
;
namespace
sr
=
defaults
::
scheduler
;
max_throughput_
=
get_or
(
cfg
,
"scheduler.max-throughput"
,
sr
::
max_throughput
);
max_throughput_
=
get_or
(
cfg
,
"caf.scheduler.max-throughput"
,
if
(
auto
num_workers
=
get_if
<
size_t
>
(
&
cfg
,
"scheduler.max-threads"
))
sr
::
max_throughput
);
if
(
auto
num_workers
=
get_if
<
size_t
>
(
&
cfg
,
"caf.scheduler.max-threads"
))
num_workers_
=
*
num_workers
;
num_workers_
=
*
num_workers
;
else
else
num_workers_
=
default_thread_count
();
num_workers_
=
default_thread_count
();
...
...
libcaf_core/test/actor_lifetime.cpp
View file @
2131e2cb
...
@@ -109,7 +109,7 @@ behavior tester(event_based_actor* self, const actor& aut) {
...
@@ -109,7 +109,7 @@ behavior tester(event_based_actor* self, const actor& aut) {
struct
config
:
actor_system_config
{
struct
config
:
actor_system_config
{
config
()
{
config
()
{
set
(
"scheduler.policy"
,
"testing"
);
set
(
"
caf.
scheduler.policy"
,
"testing"
);
}
}
};
};
...
...
libcaf_core/test/logger.cpp
View file @
2131e2cb
...
@@ -61,7 +61,9 @@ namespace {
...
@@ -61,7 +61,9 @@ namespace {
struct
fixture
{
struct
fixture
{
fixture
()
{
fixture
()
{
cfg
.
set
(
"scheduler.policy"
,
"testing"
);
cfg
.
set
(
"caf.scheduler.policy"
,
"testing"
);
cfg
.
set
(
"caf.logger.file.verbosity"
,
"debug"
);
cfg
.
set
(
"caf.logger.file.path"
,
""
);
}
}
void
add
(
logger
::
field_type
kind
)
{
void
add
(
logger
::
field_type
kind
)
{
...
@@ -161,10 +163,7 @@ CAF_TEST(parse_default_format_strings) {
...
@@ -161,10 +163,7 @@ CAF_TEST(parse_default_format_strings) {
add
(
logger
::
message_field
);
add
(
logger
::
message_field
);
add
(
logger
::
newline_field
);
add
(
logger
::
newline_field
);
CAF_CHECK_EQUAL
(
logger
::
parse_format
(
file_format
),
lf
);
CAF_CHECK_EQUAL
(
logger
::
parse_format
(
file_format
),
lf
);
#if CAF_LOG_LEVEL >= 0
// Not parsed when compiling without logging enabled.
CAF_CHECK_EQUAL
(
sys
.
logger
().
file_format
(),
lf
);
CAF_CHECK_EQUAL
(
sys
.
logger
().
file_format
(),
lf
);
#endif
}
}
CAF_TEST
(
rendering
)
{
CAF_TEST
(
rendering
)
{
...
...
libcaf_core/test/native_streaming_classes.cpp
View file @
2131e2cb
...
@@ -530,7 +530,7 @@ struct fixture {
...
@@ -530,7 +530,7 @@ struct fixture {
if
(
auto
err
=
cfg
.
parse
(
caf
::
test
::
engine
::
argc
(),
if
(
auto
err
=
cfg
.
parse
(
caf
::
test
::
engine
::
argc
(),
caf
::
test
::
engine
::
argv
()))
caf
::
test
::
engine
::
argv
()))
CAF_FAIL
(
"parsing the config failed: "
<<
to_string
(
err
));
CAF_FAIL
(
"parsing the config failed: "
<<
to_string
(
err
));
cfg
.
set
(
"scheduler.policy"
,
"testing"
);
cfg
.
set
(
"
caf.
scheduler.policy"
,
"testing"
);
return
cfg
;
return
cfg
;
}
}
...
...
libcaf_core/test/thread_hook.cpp
View file @
2131e2cb
...
@@ -116,7 +116,7 @@ CAF_TEST_FIXTURE_SCOPE(counting_hook, fixture<counting_thread_hook>)
...
@@ -116,7 +116,7 @@ CAF_TEST_FIXTURE_SCOPE(counting_hook, fixture<counting_thread_hook>)
CAF_TEST
(
counting_system_without_actor
)
{
CAF_TEST
(
counting_system_without_actor
)
{
assumed_init_calls
=
1
;
assumed_init_calls
=
1
;
auto
fallback
=
scheduler
::
abstract_coordinator
::
default_thread_count
();
auto
fallback
=
scheduler
::
abstract_coordinator
::
default_thread_count
();
assumed_thread_count
=
get_or
(
cfg
,
"scheduler.max-threads"
,
fallback
)
assumed_thread_count
=
get_or
(
cfg
,
"
caf.
scheduler.max-threads"
,
fallback
)
+
1
;
// caf.clock
+
1
;
// caf.clock
auto
&
sched
=
sys
.
scheduler
();
auto
&
sched
=
sys
.
scheduler
();
if
(
sched
.
detaches_utility_actors
())
if
(
sched
.
detaches_utility_actors
())
...
@@ -126,7 +126,7 @@ CAF_TEST(counting_system_without_actor) {
...
@@ -126,7 +126,7 @@ CAF_TEST(counting_system_without_actor) {
CAF_TEST
(
counting_system_with_actor
)
{
CAF_TEST
(
counting_system_with_actor
)
{
assumed_init_calls
=
1
;
assumed_init_calls
=
1
;
auto
fallback
=
scheduler
::
abstract_coordinator
::
default_thread_count
();
auto
fallback
=
scheduler
::
abstract_coordinator
::
default_thread_count
();
assumed_thread_count
=
get_or
(
cfg
,
"scheduler.max-threads"
,
fallback
)
assumed_thread_count
=
get_or
(
cfg
,
"
caf.
scheduler.max-threads"
,
fallback
)
+
2
;
// caf.clock and detached actor
+
2
;
// caf.clock and detached actor
auto
&
sched
=
sys
.
scheduler
();
auto
&
sched
=
sys
.
scheduler
();
if
(
sched
.
detaches_utility_actors
())
if
(
sched
.
detaches_utility_actors
())
...
...
libcaf_io/src/io/basp/instance.cpp
View file @
2131e2cb
...
@@ -44,7 +44,7 @@ instance::instance(abstract_broker* parent, callee& lstnr)
...
@@ -44,7 +44,7 @@ instance::instance(abstract_broker* parent, callee& lstnr)
:
tbl_
(
parent
),
this_node_
(
parent
->
system
().
node
()),
callee_
(
lstnr
)
{
:
tbl_
(
parent
),
this_node_
(
parent
->
system
().
node
()),
callee_
(
lstnr
)
{
CAF_ASSERT
(
this_node_
!=
none
);
CAF_ASSERT
(
this_node_
!=
none
);
size_t
workers
;
size_t
workers
;
if
(
auto
workers_cfg
=
get_if
<
size_t
>
(
&
config
(),
"middleman.workers"
))
if
(
auto
workers_cfg
=
get_if
<
size_t
>
(
&
config
(),
"
caf.
middleman.workers"
))
workers
=
*
workers_cfg
;
workers
=
*
workers_cfg
;
else
else
workers
=
std
::
min
(
3u
,
std
::
thread
::
hardware_concurrency
()
/
4u
)
+
1
;
workers
=
std
::
min
(
3u
,
std
::
thread
::
hardware_concurrency
()
/
4u
)
+
1
;
...
@@ -231,7 +231,8 @@ void instance::write_server_handshake(execution_unit* ctx, byte_buffer& out_buf,
...
@@ -231,7 +231,8 @@ void instance::write_server_handshake(execution_unit* ctx, byte_buffer& out_buf,
auto
writer
=
make_callback
([
&
](
binary_serializer
&
sink
)
{
auto
writer
=
make_callback
([
&
](
binary_serializer
&
sink
)
{
using
string_list
=
std
::
vector
<
std
::
string
>
;
using
string_list
=
std
::
vector
<
std
::
string
>
;
string_list
app_ids
;
string_list
app_ids
;
if
(
auto
ids
=
get_if
<
string_list
>
(
&
config
(),
"middleman.app-identifiers"
))
if
(
auto
ids
=
get_if
<
string_list
>
(
&
config
(),
"caf.middleman.app-identifiers"
))
app_ids
=
std
::
move
(
*
ids
);
app_ids
=
std
::
move
(
*
ids
);
else
else
app_ids
.
emplace_back
(
to_string
(
defaults
::
middleman
::
app_identifier
));
app_ids
.
emplace_back
(
to_string
(
defaults
::
middleman
::
app_identifier
));
...
@@ -323,7 +324,8 @@ connection_state instance::handle(execution_unit* ctx, connection_handle hdl,
...
@@ -323,7 +324,8 @@ connection_state instance::handle(execution_unit* ctx, connection_handle hdl,
}
}
// Check the application ID.
// Check the application ID.
string_list
whitelist
;
string_list
whitelist
;
if
(
auto
ls
=
get_if
<
string_list
>
(
&
config
(),
"middleman.app-identifiers"
))
if
(
auto
ls
=
get_if
<
string_list
>
(
&
config
(),
"caf.middleman.app-identifiers"
))
whitelist
=
std
::
move
(
*
ls
);
whitelist
=
std
::
move
(
*
ls
);
else
else
whitelist
.
emplace_back
(
to_string
(
defaults
::
middleman
::
app_identifier
));
whitelist
.
emplace_back
(
to_string
(
defaults
::
middleman
::
app_identifier
));
...
...
libcaf_io/src/io/basp_broker.cpp
View file @
2131e2cb
...
@@ -105,7 +105,7 @@ behavior basp_broker::make_behavior() {
...
@@ -105,7 +105,7 @@ behavior basp_broker::make_behavior() {
set_down_handler
([](
local_actor
*
ptr
,
down_msg
&
x
)
{
set_down_handler
([](
local_actor
*
ptr
,
down_msg
&
x
)
{
static_cast
<
basp_broker
*>
(
ptr
)
->
handle_down_msg
(
x
);
static_cast
<
basp_broker
*>
(
ptr
)
->
handle_down_msg
(
x
);
});
});
if
(
get_or
(
config
(),
"middleman.enable-automatic-connections"
,
false
))
{
if
(
get_or
(
config
(),
"
caf.
middleman.enable-automatic-connections"
,
false
))
{
CAF_LOG_DEBUG
(
"enable automatic connections"
);
CAF_LOG_DEBUG
(
"enable automatic connections"
);
// open a random port and store a record for our peers how to
// open a random port and store a record for our peers how to
// connect to this broker directly in the configuration server
// connect to this broker directly in the configuration server
...
@@ -120,7 +120,7 @@ behavior basp_broker::make_behavior() {
...
@@ -120,7 +120,7 @@ behavior basp_broker::make_behavior() {
}
}
automatic_connections
=
true
;
automatic_connections
=
true
;
}
}
auto
heartbeat_interval
=
get_or
(
config
(),
"middleman.heartbeat-interval"
,
auto
heartbeat_interval
=
get_or
(
config
(),
"
caf.
middleman.heartbeat-interval"
,
defaults
::
middleman
::
heartbeat_interval
);
defaults
::
middleman
::
heartbeat_interval
);
if
(
heartbeat_interval
>
0
)
{
if
(
heartbeat_interval
>
0
)
{
CAF_LOG_DEBUG
(
"enable heartbeat"
<<
CAF_ARG
(
heartbeat_interval
));
CAF_LOG_DEBUG
(
"enable heartbeat"
<<
CAF_ARG
(
heartbeat_interval
));
...
@@ -585,7 +585,7 @@ void basp_broker::learned_new_node_indirectly(const node_id& nid) {
...
@@ -585,7 +585,7 @@ void basp_broker::learned_new_node_indirectly(const node_id& nid) {
// connection to the routing table; hence, spawning our helper here exactly
// connection to the routing table; hence, spawning our helper here exactly
// once and there is no need to track in-flight connection requests.
// once and there is no need to track in-flight connection requests.
using
namespace
detail
;
using
namespace
detail
;
auto
tmp
=
get_or
(
config
(),
"middleman.attach-utility-actors"
,
false
)
auto
tmp
=
get_or
(
config
(),
"
caf.
middleman.attach-utility-actors"
,
false
)
?
system
().
spawn
<
hidden
>
(
connection_helper
,
this
)
?
system
().
spawn
<
hidden
>
(
connection_helper
,
this
)
:
system
().
spawn
<
detached
+
hidden
>
(
connection_helper
,
this
);
:
system
().
spawn
<
detached
+
hidden
>
(
connection_helper
,
this
);
auto
sender
=
actor_cast
<
strong_actor_ptr
>
(
tmp
);
auto
sender
=
actor_cast
<
strong_actor_ptr
>
(
tmp
);
...
...
libcaf_io/src/io/middleman.cpp
View file @
2131e2cb
...
@@ -87,7 +87,7 @@ void middleman::init_global_meta_objects() {
...
@@ -87,7 +87,7 @@ void middleman::init_global_meta_objects() {
}
}
actor_system
::
module
*
middleman
::
make
(
actor_system
&
sys
,
detail
::
type_list
<>
)
{
actor_system
::
module
*
middleman
::
make
(
actor_system
&
sys
,
detail
::
type_list
<>
)
{
auto
impl
=
get_or
(
sys
.
config
(),
"middleman.network-backend"
,
auto
impl
=
get_or
(
sys
.
config
(),
"
caf.
middleman.network-backend"
,
defaults
::
middleman
::
network_backend
);
defaults
::
middleman
::
network_backend
);
if
(
impl
==
"testing"
)
if
(
impl
==
"testing"
)
return
new
mm_impl
<
network
::
test_multiplexer
>
(
sys
);
return
new
mm_impl
<
network
::
test_multiplexer
>
(
sys
);
...
@@ -272,7 +272,7 @@ strong_actor_ptr middleman::remote_lookup(std::string name,
...
@@ -272,7 +272,7 @@ strong_actor_ptr middleman::remote_lookup(std::string name,
void
middleman
::
start
()
{
void
middleman
::
start
()
{
CAF_LOG_TRACE
(
""
);
CAF_LOG_TRACE
(
""
);
// Launch backend.
// Launch backend.
if
(
!
get_or
(
config
(),
"middleman.manual-multiplexing"
,
false
))
if
(
!
get_or
(
config
(),
"
caf.
middleman.manual-multiplexing"
,
false
))
backend_supervisor_
=
backend
().
make_supervisor
();
backend_supervisor_
=
backend
().
make_supervisor
();
// The only backend that returns a `nullptr` by default is the
// The only backend that returns a `nullptr` by default is the
// `test_multiplexer` which does not have its own thread but uses the main
// `test_multiplexer` which does not have its own thread but uses the main
...
@@ -332,7 +332,7 @@ void middleman::stop() {
...
@@ -332,7 +332,7 @@ void middleman::stop() {
}
}
}
}
});
});
if
(
!
get_or
(
config
(),
"middleman.manual-multiplexing"
,
false
))
{
if
(
!
get_or
(
config
(),
"
caf.
middleman.manual-multiplexing"
,
false
))
{
backend_supervisor_
.
reset
();
backend_supervisor_
.
reset
();
if
(
thread_
.
joinable
())
if
(
thread_
.
joinable
())
thread_
.
join
();
thread_
.
join
();
...
@@ -343,7 +343,7 @@ void middleman::stop() {
...
@@ -343,7 +343,7 @@ void middleman::stop() {
named_brokers_
.
clear
();
named_brokers_
.
clear
();
scoped_actor
self
{
system
(),
true
};
scoped_actor
self
{
system
(),
true
};
self
->
send_exit
(
manager_
,
exit_reason
::
kill
);
self
->
send_exit
(
manager_
,
exit_reason
::
kill
);
if
(
!
get_or
(
config
(),
"middleman.attach-utility-actors"
,
false
))
if
(
!
get_or
(
config
(),
"
caf.
middleman.attach-utility-actors"
,
false
))
self
->
wait_for
(
manager_
);
self
->
wait_for
(
manager_
);
destroy
(
manager_
);
destroy
(
manager_
);
}
}
...
@@ -351,11 +351,11 @@ void middleman::stop() {
...
@@ -351,11 +351,11 @@ void middleman::stop() {
void
middleman
::
init
(
actor_system_config
&
cfg
)
{
void
middleman
::
init
(
actor_system_config
&
cfg
)
{
// Note: logging is not available at this stage.
// Note: logging is not available at this stage.
// Never detach actors when using the testing multiplexer.
// Never detach actors when using the testing multiplexer.
auto
network_backend
=
get_or
(
cfg
,
"middleman.network-backend"
,
auto
network_backend
=
get_or
(
cfg
,
"
caf.
middleman.network-backend"
,
defaults
::
middleman
::
network_backend
);
defaults
::
middleman
::
network_backend
);
if
(
network_backend
==
"testing"
)
{
if
(
network_backend
==
"testing"
)
{
cfg
.
set
(
"middleman.attach-utility-actors"
,
true
)
cfg
.
set
(
"
caf.
middleman.attach-utility-actors"
,
true
)
.
set
(
"middleman.manual-multiplexing"
,
true
);
.
set
(
"
caf.
middleman.manual-multiplexing"
,
true
);
}
}
// Add remote group module to config.
// Add remote group module to config.
struct
remote_groups
:
group_module
{
struct
remote_groups
:
group_module
{
...
...
libcaf_io/src/io/middleman_actor.cpp
View file @
2131e2cb
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
namespace
caf
::
io
{
namespace
caf
::
io
{
middleman_actor
make_middleman_actor
(
actor_system
&
sys
,
actor
db
)
{
middleman_actor
make_middleman_actor
(
actor_system
&
sys
,
actor
db
)
{
return
get_or
(
sys
.
config
(),
"middleman.attach-utility-actors"
,
false
)
return
get_or
(
sys
.
config
(),
"
caf.
middleman.attach-utility-actors"
,
false
)
?
sys
.
spawn
<
middleman_actor_impl
,
hidden
>
(
std
::
move
(
db
))
?
sys
.
spawn
<
middleman_actor_impl
,
hidden
>
(
std
::
move
(
db
))
:
sys
.
spawn
<
middleman_actor_impl
,
detached
+
hidden
>
(
std
::
move
(
db
));
:
sys
.
spawn
<
middleman_actor_impl
,
detached
+
hidden
>
(
std
::
move
(
db
));
}
}
...
...
libcaf_io/src/io/network/datagram_handler.cpp
View file @
2131e2cb
...
@@ -39,7 +39,7 @@ datagram_handler::datagram_handler(default_multiplexer& backend_ref,
...
@@ -39,7 +39,7 @@ datagram_handler::datagram_handler(default_multiplexer& backend_ref,
native_socket
sockfd
)
native_socket
sockfd
)
:
event_handler
(
backend_ref
,
sockfd
),
:
event_handler
(
backend_ref
,
sockfd
),
max_consecutive_reads_
(
get_or
(
backend
().
system
().
config
(),
max_consecutive_reads_
(
get_or
(
backend
().
system
().
config
(),
"middleman.max-consecutive-reads"
,
"
caf.
middleman.max-consecutive-reads"
,
defaults
::
middleman
::
max_consecutive_reads
)),
defaults
::
middleman
::
max_consecutive_reads
)),
max_datagram_size_
(
receive_buffer_size
),
max_datagram_size_
(
receive_buffer_size
),
rd_buf_
(
receive_buffer_size
),
rd_buf_
(
receive_buffer_size
),
...
...
libcaf_io/src/io/network/default_multiplexer.cpp
View file @
2131e2cb
...
@@ -589,8 +589,8 @@ void default_multiplexer::init() {
...
@@ -589,8 +589,8 @@ void default_multiplexer::init() {
}
}
#endif
#endif
namespace
sr
=
defaults
::
scheduler
;
namespace
sr
=
defaults
::
scheduler
;
max_throughput_
max_throughput_
=
get_or
(
system
().
config
(),
"caf.scheduler.max-throughput"
,
=
get_or
(
system
().
config
(),
"scheduler.max-throughput"
,
sr
::
max_throughput
);
sr
::
max_throughput
);
}
}
bool
default_multiplexer
::
poll_once
(
bool
block
)
{
bool
default_multiplexer
::
poll_once
(
bool
block
)
{
...
...
libcaf_io/src/io/network/stream.cpp
View file @
2131e2cb
...
@@ -31,7 +31,7 @@ namespace caf::io::network {
...
@@ -31,7 +31,7 @@ namespace caf::io::network {
stream
::
stream
(
default_multiplexer
&
backend_ref
,
native_socket
sockfd
)
stream
::
stream
(
default_multiplexer
&
backend_ref
,
native_socket
sockfd
)
:
event_handler
(
backend_ref
,
sockfd
),
:
event_handler
(
backend_ref
,
sockfd
),
max_consecutive_reads_
(
get_or
(
backend
().
system
().
config
(),
max_consecutive_reads_
(
get_or
(
backend
().
system
().
config
(),
"middleman.max-consecutive-reads"
,
"
caf.
middleman.max-consecutive-reads"
,
defaults
::
middleman
::
max_consecutive_reads
)),
defaults
::
middleman
::
max_consecutive_reads
)),
read_threshold_
(
1
),
read_threshold_
(
1
),
collected_
(
0
),
collected_
(
0
),
...
...
libcaf_io/test/io/basp_broker.cpp
View file @
2131e2cb
...
@@ -105,10 +105,10 @@ class fixture {
...
@@ -105,10 +105,10 @@ class fixture {
public:
public:
fixture
(
bool
autoconn
=
false
)
fixture
(
bool
autoconn
=
false
)
:
sys
(
cfg
.
load
<
io
::
middleman
,
network
::
test_multiplexer
>
()
:
sys
(
cfg
.
load
<
io
::
middleman
,
network
::
test_multiplexer
>
()
.
set
(
"middleman.enable-automatic-connections"
,
autoconn
)
.
set
(
"
caf.
middleman.enable-automatic-connections"
,
autoconn
)
.
set
(
"middleman.workers"
,
size_t
{
0
})
.
set
(
"
caf.
middleman.workers"
,
size_t
{
0
})
.
set
(
"scheduler.policy"
,
autoconn
?
"testing"
:
"stealing"
)
.
set
(
"
caf.
scheduler.policy"
,
autoconn
?
"testing"
:
"stealing"
)
.
set
(
"middleman.attach-utility-actors"
,
autoconn
))
{
.
set
(
"
caf.
middleman.attach-utility-actors"
,
autoconn
))
{
app_ids
.
emplace_back
(
to_string
(
defaults
::
middleman
::
app_identifier
));
app_ids
.
emplace_back
(
to_string
(
defaults
::
middleman
::
app_identifier
));
auto
&
mm
=
sys
.
middleman
();
auto
&
mm
=
sys
.
middleman
();
mpx_
=
dynamic_cast
<
network
::
test_multiplexer
*>
(
&
mm
.
backend
());
mpx_
=
dynamic_cast
<
network
::
test_multiplexer
*>
(
&
mm
.
backend
());
...
...
libcaf_openssl/src/openssl/manager.cpp
View file @
2131e2cb
...
@@ -104,7 +104,7 @@ void manager::stop() {
...
@@ -104,7 +104,7 @@ void manager::stop() {
CAF_LOG_TRACE
(
""
);
CAF_LOG_TRACE
(
""
);
scoped_actor
self
{
system
(),
true
};
scoped_actor
self
{
system
(),
true
};
self
->
send_exit
(
manager_
,
exit_reason
::
kill
);
self
->
send_exit
(
manager_
,
exit_reason
::
kill
);
if
(
!
get_or
(
config
(),
"middleman.attach-utility-actors"
,
false
))
if
(
!
get_or
(
config
(),
"
caf.
middleman.attach-utility-actors"
,
false
))
self
->
wait_for
(
manager_
);
self
->
wait_for
(
manager_
);
manager_
=
nullptr
;
manager_
=
nullptr
;
}
}
...
...
libcaf_openssl/src/openssl/middleman_actor.cpp
View file @
2131e2cb
...
@@ -284,7 +284,7 @@ private:
...
@@ -284,7 +284,7 @@ private:
}
// namespace
}
// namespace
io
::
middleman_actor
make_middleman_actor
(
actor_system
&
sys
,
actor
db
)
{
io
::
middleman_actor
make_middleman_actor
(
actor_system
&
sys
,
actor
db
)
{
return
!
get_or
(
sys
.
config
(),
"middleman.attach-utility-actors"
,
false
)
return
!
get_or
(
sys
.
config
(),
"
caf.
middleman.attach-utility-actors"
,
false
)
?
sys
.
spawn
<
middleman_actor_impl
,
detached
+
hidden
>
(
std
::
move
(
db
))
?
sys
.
spawn
<
middleman_actor_impl
,
detached
+
hidden
>
(
std
::
move
(
db
))
:
sys
.
spawn
<
middleman_actor_impl
,
hidden
>
(
std
::
move
(
db
));
:
sys
.
spawn
<
middleman_actor_impl
,
hidden
>
(
std
::
move
(
db
));
}
}
...
...
libcaf_openssl/test/openssl/authentication.cpp
View file @
2131e2cb
...
@@ -54,9 +54,9 @@ public:
...
@@ -54,9 +54,9 @@ public:
config
()
{
config
()
{
load
<
io
::
middleman
>
();
load
<
io
::
middleman
>
();
load
<
openssl
::
manager
>
();
load
<
openssl
::
manager
>
();
set
(
"middleman.manual-multiplexing"
,
true
);
set
(
"
caf.
middleman.manual-multiplexing"
,
true
);
set
(
"middleman.attach-utility-actors"
,
true
);
set
(
"
caf.
middleman.attach-utility-actors"
,
true
);
set
(
"scheduler.policy"
,
"testing"
);
set
(
"
caf.
scheduler.policy"
,
"testing"
);
}
}
static
std
::
string
data_dir
()
{
static
std
::
string
data_dir
()
{
...
...
libcaf_openssl/test/openssl/remote_actor.cpp
View file @
2131e2cb
...
@@ -45,7 +45,7 @@ public:
...
@@ -45,7 +45,7 @@ public:
// OpenSSL to buffer data internally and report "pending" data after a read
// OpenSSL to buffer data internally and report "pending" data after a read
// operation. This will trigger `must_read_more` in the SSL read policy
// operation. This will trigger `must_read_more` in the SSL read policy
// with high probability.
// with high probability.
set
(
"middleman.max-consecutive-reads"
,
1
);
set
(
"
caf.
middleman.max-consecutive-reads"
,
1
);
}
}
};
};
...
...
libcaf_test/caf/test/dsl.hpp
View file @
2131e2cb
...
@@ -674,16 +674,15 @@ public:
...
@@ -674,16 +674,15 @@ public:
// -- constructors, destructors, and assignment operators --------------------
// -- constructors, destructors, and assignment operators --------------------
static
Config
&
init_config
(
Config
&
cfg
)
{
static
Config
&
init_config
(
Config
&
cfg
)
{
cfg
.
set
(
"logger.file-verbosity"
,
"quiet"
);
if
(
auto
err
=
cfg
.
parse
(
caf
::
test
::
engine
::
argc
(),
if
(
auto
err
=
cfg
.
parse
(
caf
::
test
::
engine
::
argc
(),
caf
::
test
::
engine
::
argv
()))
caf
::
test
::
engine
::
argv
()))
CAF_FAIL
(
"failed to parse config: "
<<
to_string
(
err
));
CAF_FAIL
(
"failed to parse config: "
<<
to_string
(
err
));
cfg
.
set
(
"scheduler.policy"
,
"testing"
);
cfg
.
set
(
"
caf.
scheduler.policy"
,
"testing"
);
cfg
.
set
(
"logger.inline-output"
,
true
);
cfg
.
set
(
"
caf.
logger.inline-output"
,
true
);
cfg
.
set
(
"middleman.network-backend"
,
"testing"
);
cfg
.
set
(
"
caf.
middleman.network-backend"
,
"testing"
);
cfg
.
set
(
"middleman.manual-multiplexing"
,
true
);
cfg
.
set
(
"
caf.
middleman.manual-multiplexing"
,
true
);
cfg
.
set
(
"middleman.workers"
,
size_t
{
0
});
cfg
.
set
(
"
caf.
middleman.workers"
,
size_t
{
0
});
cfg
.
set
(
"stream.credit-policy"
,
"testing"
);
cfg
.
set
(
"
caf.
stream.credit-policy"
,
"testing"
);
return
cfg
;
return
cfg
;
}
}
...
...
tools/caf-run.cpp
View file @
2131e2cb
...
@@ -176,10 +176,10 @@ void bootstrap(actor_system& system, const string& wdir,
...
@@ -176,10 +176,10 @@ void bootstrap(actor_system& system, const string& wdir,
std
::
ostringstream
oss
;
std
::
ostringstream
oss
;
oss
<<
cmd
;
oss
<<
cmd
;
if
(
slave
.
cpu_slots
>
0
)
if
(
slave
.
cpu_slots
>
0
)
oss
<<
" --caf
#
scheduler.max-threads="
<<
slave
.
cpu_slots
;
oss
<<
" --caf
.
scheduler.max-threads="
<<
slave
.
cpu_slots
;
oss
<<
" --caf
#
slave-mode"
oss
<<
" --caf
.
slave-mode"
<<
" --caf
#
slave-name="
<<
slave
.
host
<<
" --caf
.
slave-name="
<<
slave
.
host
<<
" --caf
#
bootstrap-node="
;
<<
" --caf
.
bootstrap-node="
;
bool
is_first
=
true
;
bool
is_first
=
true
;
interfaces
::
traverse
({
protocol
::
ipv4
,
protocol
::
ipv6
},
interfaces
::
traverse
({
protocol
::
ipv4
,
protocol
::
ipv6
},
[
&
](
const
char
*
,
protocol
::
network
,
[
&
](
const
char
*
,
protocol
::
network
,
...
@@ -216,7 +216,7 @@ void bootstrap(actor_system& system, const string& wdir,
...
@@ -216,7 +216,7 @@ void bootstrap(actor_system& system, const string& wdir,
}
}
// run (and wait for) master
// run (and wait for) master
std
::
ostringstream
oss
;
std
::
ostringstream
oss
;
oss
<<
cmd
<<
" --caf
#
slave-nodes="
<<
slaveslist
<<
" "
<<
join
(
args
,
" "
);
oss
<<
cmd
<<
" --caf
.
slave-nodes="
<<
slaveslist
<<
" "
<<
join
(
args
,
" "
);
run_ssh
(
system
,
wdir
,
oss
.
str
(),
master
.
host
);
run_ssh
(
system
,
wdir
,
oss
.
str
(),
master
.
host
);
}
}
...
...
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