Commit 69c57acf authored by Jakob Otto's avatar Jakob Otto

Initialize worker hub

parent b56f485f
......@@ -26,8 +26,11 @@
#include <vector>
#include "caf/actor_addr.hpp"
#include "caf/actor_system.hpp"
#include "caf/actor_system_config.hpp"
#include "caf/byte.hpp"
#include "caf/callback.hpp"
#include "caf/defaults.hpp"
#include "caf/detail/worker_hub.hpp"
#include "caf/error.hpp"
#include "caf/net/basp/connection_state.hpp"
......@@ -80,6 +83,10 @@ public:
// Allow unit tests to run the application without endpoint manager.
if (!std::is_base_of<test_tag, Parent>::value)
manager_ = &parent.manager();
auto workers = get_or(system_->config(), "middleman.workers",
defaults::middleman::workers);
for (size_t i = 0; i < workers; ++i)
hub_->add_new_worker(*queue_, proxies_);
// Write handshake.
auto hdr = parent.next_header_buffer();
auto payload = parent.next_buffer();
......
......@@ -252,6 +252,8 @@ error application::handle_handshake(packet_writer&, header hdr,
error application::handle_actor_message(packet_writer&, header hdr,
byte_span payload) {
auto worker = hub_->pop();
// TODO: This copy is nessecary because the worker interface expects a buffer
// type...
buffer_type buf(payload.begin(), payload.end());
if (worker != nullptr) {
CAF_LOG_DEBUG("launch BASP worker for deserializing an actor_message");
......
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