Commit 5cf246d8 authored by Jakob Otto's avatar Jakob Otto

Cleanup dispatcher and worker

parent 4ce15c7f
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <vector> #include <vector>
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
#include "caf/ip_endpoint.hpp"
#include "caf/logger.hpp" #include "caf/logger.hpp"
#include "caf/net/endpoint_manager.hpp" #include "caf/net/endpoint_manager.hpp"
#include "caf/net/fwd.hpp" #include "caf/net/fwd.hpp"
......
...@@ -18,16 +18,12 @@ ...@@ -18,16 +18,12 @@
#pragma once #pragma once
#include "caf/byte.hpp" #include "caf/net/endpoint_manager_queue.hpp"
#include "caf/ip_endpoint.hpp"
#include "caf/net/endpoint_manager.hpp"
#include "caf/net/fwd.hpp" #include "caf/net/fwd.hpp"
#include "caf/net/packet_writer_decorator.hpp" #include "caf/net/packet_writer_decorator.hpp"
#include "caf/span.hpp"
#include "caf/unit.hpp" #include "caf/unit.hpp"
namespace caf { namespace caf::net {
namespace net {
/// Implements a worker for transport protocols. /// Implements a worker for transport protocols.
template <class Application, class IdType> template <class Application, class IdType>
...@@ -41,7 +37,8 @@ public: ...@@ -41,7 +37,8 @@ public:
// -- constructors, destructors, and assignment operators -------------------- // -- constructors, destructors, and assignment operators --------------------
transport_worker(application_type application, id_type id = id_type{}) explicit transport_worker(application_type application,
id_type id = id_type{})
: application_(std::move(application)), id_(std::move(id)) { : application_(std::move(application)), id_(std::move(id)) {
// nop // nop
} }
...@@ -119,5 +116,4 @@ template <class Application, class IdType = unit_t> ...@@ -119,5 +116,4 @@ template <class Application, class IdType = unit_t>
using transport_worker_ptr = std::shared_ptr< using transport_worker_ptr = std::shared_ptr<
transport_worker<Application, IdType>>; transport_worker<Application, IdType>>;
} // namespace net } // namespace caf::net
} // namespace caf
...@@ -18,19 +18,15 @@ ...@@ -18,19 +18,15 @@
#pragma once #pragma once
#include <caf/logger.hpp>
#include <caf/sec.hpp>
#include <unordered_map> #include <unordered_map>
#include "caf/byte.hpp" #include "caf/logger.hpp"
#include "caf/ip_endpoint.hpp" #include "caf/net/endpoint_manager_queue.hpp"
#include "caf/net/endpoint_manager.hpp"
#include "caf/net/fwd.hpp" #include "caf/net/fwd.hpp"
#include "caf/net/packet_writer_decorator.hpp" #include "caf/net/packet_writer_decorator.hpp"
#include "caf/net/transport_worker.hpp" #include "caf/net/transport_worker.hpp"
#include "caf/sec.hpp"
#include "caf/send.hpp" #include "caf/send.hpp"
#include "caf/span.hpp"
#include "caf/unit.hpp"
namespace caf::net { namespace caf::net {
...@@ -52,7 +48,7 @@ public: ...@@ -52,7 +48,7 @@ public:
// -- constructors, destructors, and assignment operators -------------------- // -- constructors, destructors, and assignment operators --------------------
transport_worker_dispatcher(factory_type factory) explicit transport_worker_dispatcher(factory_type factory)
: factory_(std::move(factory)) { : factory_(std::move(factory)) {
// nop // nop
} }
...@@ -138,6 +134,7 @@ public: ...@@ -138,6 +134,7 @@ public:
template <class Parent> template <class Parent>
expected<worker_ptr> add_new_worker(Parent& parent, node_id node, expected<worker_ptr> add_new_worker(Parent& parent, node_id node,
id_type id) { id_type id) {
CAF_LOG_TRACE(CAF_ARG(node) << CAF_ARG(id));
auto application = factory_.make(); auto application = factory_.make();
auto worker = std::make_shared<worker_type>(std::move(application), id); auto worker = std::make_shared<worker_type>(std::move(application), id);
if (auto err = worker->init(parent)) if (auto err = worker->init(parent))
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
#include "caf/byte.hpp" #include "caf/byte.hpp"
#include "caf/detail/scope_guard.hpp" #include "caf/detail/scope_guard.hpp"
#include "caf/ip_endpoint.hpp"
#include "caf/make_actor.hpp" #include "caf/make_actor.hpp"
#include "caf/net/actor_proxy_impl.hpp" #include "caf/net/actor_proxy_impl.hpp"
#include "caf/net/endpoint_manager.hpp"
#include "caf/net/multiplexer.hpp" #include "caf/net/multiplexer.hpp"
#include "caf/serializer_impl.hpp" #include "caf/serializer_impl.hpp"
#include "caf/span.hpp" #include "caf/span.hpp"
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "caf/net/test/host_fixture.hpp" #include "caf/net/test/host_fixture.hpp"
#include "caf/test/dsl.hpp" #include "caf/test/dsl.hpp"
#include "caf/ip_endpoint.hpp"
#include "caf/make_actor.hpp" #include "caf/make_actor.hpp"
#include "caf/monitorable_actor.hpp" #include "caf/monitorable_actor.hpp"
#include "caf/node_id.hpp" #include "caf/node_id.hpp"
......
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