Commit 0541cbae authored by Dominik Charousset's avatar Dominik Charousset

Remove all deprecated functionality

parent 035bfe0a
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "caf/actor_marker.hpp" #include "caf/actor_marker.hpp"
#include "caf/abstract_actor.hpp" #include "caf/abstract_actor.hpp"
#include "caf/actor_control_block.hpp" #include "caf/actor_control_block.hpp"
#include "caf/unsafe_actor_handle_init.hpp"
#include "caf/detail/comparable.hpp" #include "caf/detail/comparable.hpp"
#include "caf/detail/type_traits.hpp" #include "caf/detail/type_traits.hpp"
...@@ -82,8 +81,6 @@ public: ...@@ -82,8 +81,6 @@ public:
actor(const scoped_actor&); actor(const scoped_actor&);
explicit actor(const unsafe_actor_handle_init_t&) CAF_DEPRECATED;
template <class T, template <class T,
class = typename std::enable_if< class = typename std::enable_if<
std::is_base_of<dynamically_typed_actor_base, T>::value std::is_base_of<dynamically_typed_actor_base, T>::value
...@@ -143,12 +140,6 @@ public: ...@@ -143,12 +140,6 @@ public:
/// Exchange content of `*this` and `other`. /// Exchange content of `*this` and `other`.
void swap(actor& other) noexcept; void swap(actor& other) noexcept;
/// Queries whether this object was constructed using
/// `unsafe_actor_handle_init` or is in moved-from state.
bool unsafe() const CAF_DEPRECATED {
return !ptr_;
}
/// @cond PRIVATE /// @cond PRIVATE
inline abstract_actor* operator->() const noexcept { inline abstract_actor* operator->() const noexcept {
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
#include "caf/abstract_actor.hpp" #include "caf/abstract_actor.hpp"
#include "caf/actor_control_block.hpp" #include "caf/actor_control_block.hpp"
#include "caf/unsafe_actor_handle_init.hpp"
#include "caf/detail/comparable.hpp" #include "caf/detail/comparable.hpp"
...@@ -57,7 +56,6 @@ public: ...@@ -57,7 +56,6 @@ public:
actor_addr& operator=(const actor_addr&) = default; actor_addr& operator=(const actor_addr&) = default;
actor_addr(std::nullptr_t); actor_addr(std::nullptr_t);
actor_addr(const unsafe_actor_handle_init_t&);
actor_addr& operator=(std::nullptr_t); actor_addr& operator=(std::nullptr_t);
......
...@@ -133,11 +133,6 @@ public: ...@@ -133,11 +133,6 @@ public:
actor_system_config& parse(int argc, char** argv, actor_system_config& parse(int argc, char** argv,
const char* ini_file_cstr = nullptr); const char* ini_file_cstr = nullptr);
actor_system_config&
parse(message& args, const char* ini_file_cstr = nullptr) CAF_DEPRECATED;
actor_system_config& parse(message& args, std::istream& ini) CAF_DEPRECATED;
/// Allows other nodes to spawn actors created by `fun` /// Allows other nodes to spawn actors created by `fun`
/// dynamically by using `name` as identifier. /// dynamically by using `name` as identifier.
/// @experimental /// @experimental
...@@ -248,9 +243,6 @@ public: ...@@ -248,9 +243,6 @@ public:
/// and instead return from `main` immediately. /// and instead return from `main` immediately.
bool cli_helptext_printed; bool cli_helptext_printed;
/// Stores CLI arguments that were not consumed by CAF.
message args_remainder CAF_DEPRECATED;
/// Stores CLI arguments that were not consumed by CAF. /// Stores CLI arguments that were not consumed by CAF.
string_list remainder; string_list remainder;
...@@ -279,49 +271,6 @@ public: ...@@ -279,49 +271,6 @@ public:
/// @private /// @private
timespan stream_tick_duration() const noexcept; timespan stream_tick_duration() const noexcept;
timespan streaming_credit_round_interval() const noexcept CAF_DEPRECATED;
// -- scheduling parameters --------------------------------------------------
atom_value scheduler_policy CAF_DEPRECATED;
size_t scheduler_max_threads CAF_DEPRECATED;
size_t scheduler_max_throughput CAF_DEPRECATED;
bool scheduler_enable_profiling CAF_DEPRECATED;
size_t scheduler_profiling_ms_resolution CAF_DEPRECATED;
std::string scheduler_profiling_output_file CAF_DEPRECATED;
// -- work-stealing parameters -----------------------------------------------
size_t work_stealing_aggressive_poll_attempts CAF_DEPRECATED;
size_t work_stealing_aggressive_steal_interval CAF_DEPRECATED;
size_t work_stealing_moderate_poll_attempts CAF_DEPRECATED;
size_t work_stealing_moderate_steal_interval CAF_DEPRECATED;
size_t work_stealing_moderate_sleep_duration_us CAF_DEPRECATED;
size_t work_stealing_relaxed_steal_interval CAF_DEPRECATED;
size_t work_stealing_relaxed_sleep_duration_us CAF_DEPRECATED;
// -- logger parameters ------------------------------------------------------
std::string logger_file_name CAF_DEPRECATED;
std::string logger_file_format CAF_DEPRECATED;
atom_value logger_console CAF_DEPRECATED;
std::string logger_console_format CAF_DEPRECATED;
std::string logger_component_filter CAF_DEPRECATED;
atom_value logger_verbosity CAF_DEPRECATED;
bool logger_inline_output CAF_DEPRECATED;
// -- middleman parameters ---------------------------------------------------
atom_value middleman_network_backend CAF_DEPRECATED;
std::string middleman_app_identifier CAF_DEPRECATED;
bool middleman_enable_automatic_connections CAF_DEPRECATED;
size_t middleman_max_consecutive_reads CAF_DEPRECATED;
size_t middleman_heartbeat_interval CAF_DEPRECATED;
bool middleman_detach_utility_actors CAF_DEPRECATED;
bool middleman_detach_multiplexer CAF_DEPRECATED;
size_t middleman_cached_udp_buffers CAF_DEPRECATED;
size_t middleman_max_pending_msgs CAF_DEPRECATED;
// -- OpenCL parameters ------------------------------------------------------ // -- OpenCL parameters ------------------------------------------------------
std::string opencl_device_ids; std::string opencl_device_ids;
......
...@@ -122,7 +122,7 @@ struct function_view_result { ...@@ -122,7 +122,7 @@ struct function_view_result {
template <class... Ts> template <class... Ts>
struct function_view_result<typed_actor<Ts...>> { struct function_view_result<typed_actor<Ts...>> {
typed_actor<Ts...> value{unsafe_actor_handle_init}; typed_actor<Ts...> value{nullptr};
}; };
/// A function view for an actor hides any messaging from the caller. /// A function view for an actor hides any messaging from the caller.
......
...@@ -200,12 +200,6 @@ public: ...@@ -200,12 +200,6 @@ public:
return f(meta::type_name("message_id"), x.value_); return f(meta::type_name("message_id"), x.value_);
} }
// -- deprecated functions ---------------------------------------------------
template <class... Ts>
static message_id make(Ts&&... xs)
CAF_DEPRECATED_MSG("use make_message_id instead");
private: private:
// -- member variables ------------------------------------------------------- // -- member variables -------------------------------------------------------
...@@ -241,13 +235,6 @@ constexpr message_id make_message_id(message_priority p) { ...@@ -241,13 +235,6 @@ constexpr message_id make_message_id(message_priority p) {
return message_id{static_cast<uint64_t>(p) << message_id::category_offset}; return message_id{static_cast<uint64_t>(p) << message_id::category_offset};
} }
// -- deprecated functions -----------------------------------------------------
template <class... Ts>
message_id message_id::make(Ts&&... xs) {
return make_message_id(std::forward<Ts>(xs)...);
}
} // namespace caf } // namespace caf
namespace std { namespace std {
......
...@@ -142,10 +142,6 @@ public: ...@@ -142,10 +142,6 @@ public:
detail::test_actor_clock& clock() noexcept override; detail::test_actor_clock& clock() noexcept override;
std::pair<size_t, size_t>
run_dispatch_loop(timespan cycle_duration = timespan{1})
CAF_DEPRECATED_MSG("use the testing DSL's run() instead");
protected: protected:
void start() override; void start() override;
......
...@@ -63,10 +63,6 @@ constexpr spawn_options detached = spawn_options::detach_flag; ...@@ -63,10 +63,6 @@ constexpr spawn_options detached = spawn_options::detach_flag;
/// Causes the runtime to ignore the new actor in `await_all_actors_done()`. /// Causes the runtime to ignore the new actor in `await_all_actors_done()`.
constexpr spawn_options hidden = spawn_options::hide_flag; constexpr spawn_options hidden = spawn_options::hide_flag;
/// Causes the new actor to evaluate message priorities.
constexpr spawn_options priority_aware CAF_DEPRECATED =
spawn_options::priority_aware_flag;
/// Causes the new actor to delay its /// Causes the new actor to delay its
/// initialization until a message arrives. /// initialization until a message arrives.
constexpr spawn_options lazy_init = spawn_options::lazy_init_flag; constexpr spawn_options lazy_init = spawn_options::lazy_init_flag;
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "caf/stateful_actor.hpp" #include "caf/stateful_actor.hpp"
#include "caf/typed_behavior.hpp" #include "caf/typed_behavior.hpp"
#include "caf/typed_response_promise.hpp" #include "caf/typed_response_promise.hpp"
#include "caf/unsafe_actor_handle_init.hpp"
#include "caf/detail/mpi_splice.hpp" #include "caf/detail/mpi_splice.hpp"
#include "caf/decorator/splitter.hpp" #include "caf/decorator/splitter.hpp"
...@@ -172,10 +171,6 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>, ...@@ -172,10 +171,6 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
return *this; return *this;
} }
explicit typed_actor(const unsafe_actor_handle_init_t&) CAF_DEPRECATED {
// nop
}
/// Queries whether this actor handle is valid. /// Queries whether this actor handle is valid.
inline explicit operator bool() const { inline explicit operator bool() const {
return static_cast<bool>(ptr_); return static_cast<bool>(ptr_);
...@@ -211,12 +206,6 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>, ...@@ -211,12 +206,6 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
ptr_.swap(other.ptr_); ptr_.swap(other.ptr_);
} }
/// Queries whether this object was constructed using
/// `unsafe_actor_handle_init` or is in moved-from state.
bool unsafe() const CAF_DEPRECATED {
return !ptr_;
}
/// @cond PRIVATE /// @cond PRIVATE
abstract_actor* operator->() const noexcept { abstract_actor* operator->() const noexcept {
......
...@@ -43,10 +43,6 @@ actor::actor(const scoped_actor& x) : ptr_(actor_cast<strong_actor_ptr>(x)) { ...@@ -43,10 +43,6 @@ actor::actor(const scoped_actor& x) : ptr_(actor_cast<strong_actor_ptr>(x)) {
// nop // nop
} }
actor::actor(const unsafe_actor_handle_init_t&) : ptr_(nullptr) {
// nop
}
actor::actor(actor_control_block* ptr) : ptr_(ptr) { actor::actor(actor_control_block* ptr) : ptr_(ptr) {
// nop // nop
} }
......
...@@ -31,10 +31,6 @@ actor_addr::actor_addr(std::nullptr_t) { ...@@ -31,10 +31,6 @@ actor_addr::actor_addr(std::nullptr_t) {
// nop // nop
} }
actor_addr::actor_addr(const unsafe_actor_handle_init_t&) {
// nop
}
actor_addr& actor_addr::operator=(std::nullptr_t) { actor_addr& actor_addr::operator=(std::nullptr_t) {
ptr_.reset(); ptr_.reset();
return *this; return *this;
......
...@@ -64,145 +64,79 @@ actor_system_config::actor_system_config() ...@@ -64,145 +64,79 @@ actor_system_config::actor_system_config()
stream_desired_batch_complexity = defaults::stream::desired_batch_complexity; stream_desired_batch_complexity = defaults::stream::desired_batch_complexity;
stream_max_batch_delay = defaults::stream::max_batch_delay; stream_max_batch_delay = defaults::stream::max_batch_delay;
stream_credit_round_interval = defaults::stream::credit_round_interval; stream_credit_round_interval = defaults::stream::credit_round_interval;
namespace sr = defaults::scheduler;
auto to_ms = [](timespan x) {
return static_cast<size_t>(x.count() / 1000000);
};
scheduler_policy = sr::policy;
scheduler_max_threads = sr::max_threads;
scheduler_max_throughput = sr::max_throughput;
scheduler_enable_profiling = false;
scheduler_profiling_ms_resolution = to_ms(sr::profiling_resolution);
namespace ws = defaults::work_stealing;
auto to_us = [](timespan x) {
return static_cast<size_t>(x.count() / 1000);
};
work_stealing_aggressive_poll_attempts = ws::aggressive_poll_attempts;
work_stealing_aggressive_steal_interval = ws::aggressive_steal_interval;
work_stealing_moderate_poll_attempts = ws::moderate_poll_attempts;
work_stealing_moderate_steal_interval = ws::moderate_steal_interval;
work_stealing_moderate_sleep_duration_us = to_us(ws::moderate_sleep_duration);
work_stealing_relaxed_steal_interval = ws::relaxed_steal_interval;
work_stealing_relaxed_sleep_duration_us = to_us(ws::relaxed_sleep_duration);
namespace lg = defaults::logger;
logger_file_name = lg::file_name;
logger_file_format = lg::file_format;
logger_console = lg::console;
logger_console_format = lg::console_format;
logger_inline_output = false;
logger_verbosity = lg::file_verbosity;
namespace mm = defaults::middleman;
middleman_network_backend = mm::network_backend;
middleman_enable_automatic_connections = false;
middleman_max_consecutive_reads = mm::max_consecutive_reads;
middleman_heartbeat_interval = mm::heartbeat_interval;
middleman_detach_utility_actors = true;
middleman_detach_multiplexer = true;
middleman_cached_udp_buffers = mm::cached_udp_buffers;
middleman_max_pending_msgs = mm::max_pending_msgs;
// fill our options vector for creating INI and CLI parsers // fill our options vector for creating INI and CLI parsers
using std::string;
opt_group{custom_options_, "global"} opt_group{custom_options_, "global"}
.add<bool>("help,h?", "print help and exit") .add<bool>("help,h?", "print help text to STDERR and exit")
.add<bool>("long-help", "print all help options and exit") .add<bool>("long-help", "print long help text to STDERR and exit")
.add<bool>("dump-config", "print configuration in INI format and exit"); .add<bool>("dump-config", "print configuration to STDERR and exit");
opt_group{custom_options_, "stream"} opt_group{custom_options_, "stream"}
.add(stream_desired_batch_complexity, "desired-batch-complexity", .add<timespan>(stream_desired_batch_complexity, "desired-batch-complexity",
"sets the desired timespan for a single batch") "processing time per batch")
.add(stream_max_batch_delay, "max-batch-delay", .add<timespan>(stream_max_batch_delay, "max-batch-delay",
"sets the maximum delay for sending underfull batches") "maximum delay for partial batches")
.add(stream_credit_round_interval, "credit-round-interval", .add<timespan>(stream_credit_round_interval, "credit-round-interval",
"sets the length of credit intervals"); "time between emitting credit");
opt_group{custom_options_, "scheduler"} opt_group{custom_options_, "scheduler"}
.add(scheduler_policy, "policy", .add<atom_value>("policy", "'stealing' (default) or 'sharing'")
"sets the scheduling policy to either 'stealing' (default) or 'sharing'") .add<size_t>("max-threads", "maximum number of worker threads")
.add(scheduler_max_threads, "max-threads", .add<size_t>("max-throughput", "nr. of messages actors can consume per run")
"sets a fixed number of worker threads for the scheduler") .add<bool>("enable-profiling", "enables profiler output")
.add(scheduler_max_throughput, "max-throughput", .add<timespan>("profiling-resolution", "data collection rate")
"sets the maximum number of messages an actor consumes before yielding") .add<string>("profiling-output-file", "output file for the profiler");
.add(scheduler_enable_profiling, "enable-profiling",
"enables or disables profiler output")
.add_ms(scheduler_profiling_ms_resolution, "profiling-ms-resolution",
"deprecated (use profiling-resolution instead)")
.add_ms(scheduler_profiling_ms_resolution, "profiling-resolution",
"sets the rate in ms in which the profiler collects data")
.add(scheduler_profiling_output_file, "profiling-output-file",
"sets the output file for the profiler");
opt_group(custom_options_, "work-stealing") opt_group(custom_options_, "work-stealing")
.add(work_stealing_aggressive_poll_attempts, "aggressive-poll-attempts", .add<size_t>("aggressive-poll-attempts", "nr. of aggressive steal attempts")
"number of zero-sleep-interval polling attempts") .add<size_t>("aggressive-steal-interval",
.add(work_stealing_aggressive_steal_interval, "aggressive-steal-interval", "frequency of aggressive steal attempts")
"frequency of steal attempts during aggressive polling") .add<size_t>("moderate-poll-attempts", "nr. of moderate steal attempts")
.add(work_stealing_moderate_poll_attempts, "moderate-poll-attempts", .add<size_t>("moderate-steal-interval",
"number of moderately aggressive polling attempts") "frequency of moderate steal attempts")
.add(work_stealing_moderate_steal_interval, "moderate-steal-interval", .add<timespan>("moderate-sleep-duration",
"frequency of steal attempts during moderate polling") "sleep duration between moderate steal attempts")
.add_us(work_stealing_moderate_sleep_duration_us, "moderate-sleep-duration", .add<size_t>("relaxed-steal-interval",
"sleep duration between poll attempts during moderate polling") "frequency of relaxed steal attempts")
.add(work_stealing_relaxed_steal_interval, "relaxed-steal-interval", .add<timespan>("relaxed-sleep-duration",
"frequency of steal attempts during relaxed polling") "sleep duration between relaxed steal attempts");
.add_us(work_stealing_relaxed_sleep_duration_us, "relaxed-sleep-duration",
"sleep duration between poll attempts during relaxed polling");
opt_group{custom_options_, "logger"} opt_group{custom_options_, "logger"}
.add(logger_file_name, "file-name", .add<atom_value>("verbosity", "default verbosity for file and console")
"sets the filesystem path of the log file") .add<string>("file-name", "filesystem path of the log file")
.add(logger_file_format, "file-format", .add<string>("file-format", "line format for individual log file entires")
"sets the line format for individual log file entires") .add<atom_value>("file-verbosity", "file output verbosity")
.add<atom_value>("file-verbosity", .add<atom_value>("console", "std::clog output: none, colored, or uncolored")
"sets the file output verbosity (quiet|error|warning|info|debug|trace)") .add<string>("console-format", "line format for printed log entires")
.add(logger_console, "console", .add<atom_value>("console-verbosity", "console output verbosity")
"sets the type of output to std::clog (none|colored|uncolored)")
.add(logger_console_format, "console-format",
"sets the line format for printing individual log entires")
.add<atom_value>("console-verbosity",
"sets the console output verbosity "
"(quiet|error|warning|info|debug|trace)")
.add(logger_component_filter, "component-filter",
"DEPRECATED/IGNORED, use component-blacklist instead")
.add<std::vector<atom_value>>("component-blacklist", .add<std::vector<atom_value>>("component-blacklist",
"exclude all listed components from logging") "excluded components for logging")
.add(logger_verbosity, "verbosity", .add<bool>("inline-output", "disable logger thread (for testing only!)");
"set file and console verbosity (deprecated)")
.add(logger_inline_output, "inline-output",
"sets whether a separate thread is used for I/O");
opt_group{custom_options_, "middleman"} opt_group{custom_options_, "middleman"}
.add(middleman_network_backend, "network-backend", .add<atom_value>("network-backend",
"sets the network backend to either 'default' or 'asio' (if available)") "either 'default' or 'asio' (if available)")
.add(middleman_app_identifier, "app-identifier", .add<string>("app-identifier", "application identifier of this node")
"sets the application identifier of this node") .add<bool>("enable-automatic-connections",
.add(middleman_enable_automatic_connections, "enable-automatic-connections",
"enables automatic connection management") "enables automatic connection management")
.add(middleman_max_consecutive_reads, "max-consecutive-reads", .add<size_t>("max-consecutive-reads",
"sets the maximum number of consecutive I/O reads per broker") "max. number of consecutive reads per broker")
.add(middleman_heartbeat_interval, "heartbeat-interval", .add<timespan>("heartbeat-interval", "interval of heartbeat messages")
"sets the interval (ms) of heartbeat, 0 (default) means disabling it") .add<bool>("attach-utility-actors",
.add(middleman_detach_utility_actors, "detach-utility-actors", "schedule utility actors instead of dedicating threads")
"deprecated, see attach-utility-actors instead") .add<bool>("manual-multiplexing",
.add_neg(middleman_detach_utility_actors, "attach-utility-actors",
"schedule utility actors instead of dedicating individual threads")
.add(middleman_detach_multiplexer, "detach-multiplexer",
"deprecated, see manual-multiplexing instead")
.add_neg(middleman_detach_multiplexer, "manual-multiplexing",
"disables background activity of the multiplexer") "disables background activity of the multiplexer")
.add(middleman_cached_udp_buffers, "cached-udp-buffers", .add<size_t>("cached-udp-buffers",
"sets the maximum for cached UDP send buffers (default: 10)") "maximum for cached UDP send buffers (default: 10)")
.add(middleman_max_pending_msgs, "max-pending-messages", .add<size_t>("max-pending-messages",
"sets the maximum for reordering of UDP receive buffers (default: 10)") "maximum for reordering of UDP receive buffers (default: 10)")
.add<bool>("disable-tcp", "disables communication via TCP") .add<bool>("disable-tcp", "disables communication via TCP")
.add<bool>("enable-udp", "enable communication via UDP"); .add<bool>("enable-udp", "enable communication via UDP");
opt_group(custom_options_, "opencl") opt_group(custom_options_, "opencl")
.add(opencl_device_ids, "device-ids", .add<std::vector<size_t>>("device-ids", "whitelist for OpenCL devices");
"restricts which OpenCL devices are accessed by CAF");
opt_group(custom_options_, "openssl") opt_group(custom_options_, "openssl")
.add(openssl_certificate, "certificate", .add<string>("certificate", "path to the PEM-formatted certificate file")
"sets the path to the file containining the certificate for this node PEM format") .add<string>("key", "path to the private key file for this node")
.add(openssl_key, "key", .add<string>("passphrase", "passphrase to decrypt the private key")
"sets the path to the file containting the private key for this node") .add<string>("capath",
.add(openssl_passphrase, "passphrase", "path to an OpenSSL-style directory of trusted certificates")
"sets the passphrase to decrypt the private key, if needed") .add<string>("cafile",
.add(openssl_capath, "capath", "path to a file of concatenated PEM-formatted certificates");
"sets the path to an OpenSSL-style directory of trusted certificates")
.add(openssl_cafile, "cafile",
"sets the path to a file containing trusted certificates concatenated together in PEM format");
// add renderers for default error categories // add renderers for default error categories
error_renderers.emplace(atom("system"), render_sec); error_renderers.emplace(atom("system"), render_sec);
error_renderers.emplace(atom("exit"), render_exit_reason); error_renderers.emplace(atom("exit"), render_exit_reason);
...@@ -328,8 +262,6 @@ actor_system_config& actor_system_config::parse(string_list args, ...@@ -328,8 +262,6 @@ actor_system_config& actor_system_config::parse(string_list args,
first += std::distance(args.cbegin(), res.second); first += std::distance(args.cbegin(), res.second);
remainder.insert(remainder.end(), make_move_iterator(first), remainder.insert(remainder.end(), make_move_iterator(first),
make_move_iterator(args.end())); make_move_iterator(args.end()));
args_remainder = message_builder{remainder.begin(), remainder.end()}
.move_to_message();
} else { } else {
cli_helptext_printed = get_or(content, "global.help", false) cli_helptext_printed = get_or(content, "global.help", false)
|| get_or(content, "global.long-help", false); || get_or(content, "global.long-help", false);
...@@ -364,24 +296,6 @@ actor_system_config& actor_system_config::parse(string_list args, ...@@ -364,24 +296,6 @@ actor_system_config& actor_system_config::parse(string_list args,
return parse(std::move(args), ini); return parse(std::move(args), ini);
} }
actor_system_config& actor_system_config::parse(message& msg,
const char* ini_file_cstr) {
string_list args;
for (size_t i = 0; i < msg.size(); ++i)
if (msg.match_element<std::string>(i))
args.emplace_back(msg.get_as<std::string>(i));
return parse(std::move(args), ini_file_cstr);
}
actor_system_config& actor_system_config::parse(message& msg,
std::istream& ini) {
string_list args;
for (size_t i = 0; i < msg.size(); ++i)
if (msg.match_element<std::string>(i))
args.emplace_back(msg.get_as<std::string>(i));
return parse(std::move(args), ini);
}
actor_system_config& actor_system_config&
actor_system_config::add_actor_factory(std::string name, actor_factory fun) { actor_system_config::add_actor_factory(std::string name, actor_factory fun) {
actor_factories.emplace(std::move(name), std::move(fun)); actor_factories.emplace(std::move(name), std::move(fun));
...@@ -410,10 +324,6 @@ timespan actor_system_config::stream_tick_duration() const noexcept { ...@@ -410,10 +324,6 @@ timespan actor_system_config::stream_tick_duration() const noexcept {
return timespan{ns_count}; return timespan{ns_count};
} }
timespan actor_system_config::streaming_credit_round_interval() const noexcept {
return stream_credit_round_interval;
}
std::string actor_system_config::render_sec(uint8_t x, atom_value, std::string actor_system_config::render_sec(uint8_t x, atom_value,
const message& xs) { const message& xs) {
auto tmp = static_cast<sec>(x); auto tmp = static_cast<sec>(x);
......
...@@ -16,15 +16,56 @@ ...@@ -16,15 +16,56 @@
* http://www.boost.org/LICENSE_1_0.txt. * * http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/ ******************************************************************************/
#pragma once #include "caf/settings.hpp"
namespace caf { namespace caf {
/// Tag type to select the unsafe constructor of actor handles. std::string get_or(const settings& xs, string_view name,
struct unsafe_actor_handle_init_t { }; string_view default_value) {
auto result = get_if<std::string>(&xs, name);
if (result)
return std::move(*result);
return std::string{default_value.begin(), default_value.end()};
}
static constexpr unsafe_actor_handle_init_t unsafe_actor_handle_init void put_impl(settings& dict, const std::vector<string_view>& path,
= unsafe_actor_handle_init_t{}; config_value& value) {
// Sanity check.
if (path.empty())
return;
// Navigate path.
auto last = path.end();
auto back = last - 1;
auto current = &dict;
// Resolve path by navigating the map-of-maps of create the necessary layout
// when needed.
for (auto i = path.begin(); i != back; ++i) {
auto iter = current->emplace(*i, settings{}).first;
if (auto val = get_if<settings>(&iter->second)) {
current = val;
} else {
iter->second = settings{};
current = &get<settings>(iter->second);
}
}
// Set key-value pair on the leaf.
current->insert_or_assign(*back, std::move(value));
}
} // namespace caf void put_impl(settings& dict, string_view key, config_value& value) {
std::vector<string_view> path;
split(path, key, ".");
put_impl(dict, path, value);
}
config_value::list& put_list(settings& xs, std::string name) {
auto i = xs.insert_or_assign(std::move(name), config_value::list{});
return get<config_value::list>(i.first->second);
}
config_value::dictionary& put_dictionary(settings& xs, std::string name) {
auto i = xs.insert_or_assign(std::move(name), settings{});
return get<config_value::dictionary>(i.first->second);
}
} // namespace caf
...@@ -161,17 +161,6 @@ void test_coordinator::inline_all_enqueues_helper() { ...@@ -161,17 +161,6 @@ void test_coordinator::inline_all_enqueues_helper() {
after_next_enqueue([=] { inline_all_enqueues_helper(); }); after_next_enqueue([=] { inline_all_enqueues_helper(); });
} }
std::pair<size_t, size_t>
test_coordinator::run_dispatch_loop(timespan cycle_duration) {
size_t messages = 0;
size_t timeouts = 0;
while (has_job() || has_pending_timeout()) {
messages += run();
timeouts += advance_time(cycle_duration);
}
return {messages, timeouts};
}
} // namespace caf } // namespace caf
} // namespace scheduler } // namespace scheduler
...@@ -33,13 +33,18 @@ using atomic_count = std::atomic<size_t>; ...@@ -33,13 +33,18 @@ using atomic_count = std::atomic<size_t>;
size_t assumed_thread_count; size_t assumed_thread_count;
size_t assumed_init_calls; size_t assumed_init_calls;
std::mutex mx;
struct dummy_thread_hook : thread_hook { struct dummy_thread_hook : thread_hook {
void init(actor_system&) override { void init(actor_system&) override {
// nop // nop
} }
void thread_started() override { void thread_started() override {
// nop void* array[20]; \
auto caf_bt_size = ::backtrace(array, 20); \
std::unique_lock<std::mutex> guard{mx};
::backtrace_symbols_fd(array, caf_bt_size, 2); \
} }
void thread_terminates() override { void thread_terminates() override {
......
...@@ -570,7 +570,6 @@ public: ...@@ -570,7 +570,6 @@ public:
caf::timespan{1000}); caf::timespan{1000});
// Make sure the current time isn't 0. // Make sure the current time isn't 0.
sched.clock().current_time += std::chrono::hours(1); sched.clock().current_time += std::chrono::hours(1);
credit_round_interval = cfg.stream_credit_round_interval;
} }
virtual ~test_coordinator_fixture() { virtual ~test_coordinator_fixture() {
...@@ -741,36 +740,8 @@ public: ...@@ -741,36 +740,8 @@ public:
/// Deterministic scheduler. /// Deterministic scheduler.
scheduler_type& sched; scheduler_type& sched;
// -- deprecated functionality -----------------------------------------------
void run_exhaustively() CAF_DEPRECATED_MSG("use run() instead");
void run_exhaustively_until(std::function<bool()> f)
CAF_DEPRECATED_MSG("use run_until() instead");
void loop_after_next_enqueue()
CAF_DEPRECATED_MSG("use run_after_next_ready_event() instead");
caf::timespan credit_round_interval CAF_DEPRECATED;
}; };
template <class Config>
void test_coordinator_fixture<Config>::run_exhaustively() {
run();
}
template <class Config>
void test_coordinator_fixture<Config>::run_exhaustively_until(
std::function<bool()> f) {
run_until(std::move(f));
}
template <class Config>
void test_coordinator_fixture<Config>::loop_after_next_enqueue() {
sched.after_next_enqueue([=] { run(); });
}
/// Unboxes an expected value or fails the test if it doesn't exist. /// Unboxes an expected value or fails the test if it doesn't exist.
template <class T> template <class T>
T unbox(caf::expected<T> x) { T unbox(caf::expected<T> x) {
......
...@@ -104,12 +104,6 @@ public: ...@@ -104,12 +104,6 @@ public:
/// Callback for triggering all nodes when simulating a network of CAF nodes. /// Callback for triggering all nodes when simulating a network of CAF nodes.
run_all_nodes_fun run_all_nodes; run_all_nodes_fun run_all_nodes;
// -- deprecated functions ---------------------------------------------------
void exec_all() CAF_DEPRECATED_MSG("use run() instead") {
this->run();
}
// -- overriding member functions -------------------------------------------- // -- overriding member functions --------------------------------------------
bool consume_message() override { bool consume_message() override {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment