Commit d6e4b796 authored by Dominik Charousset's avatar Dominik Charousset

Improve logging in stream_serv implementation

parent 3b243eb8
...@@ -290,6 +290,7 @@ void middleman::start() { ...@@ -290,6 +290,7 @@ void middleman::start() {
behavior make_behavior() override { behavior make_behavior() override {
return { return {
[=](stream_msg& x) -> delegated<message> { [=](stream_msg& x) -> delegated<message> {
CAF_LOG_TRACE(CAF_ARG(x));
// Dispatching depends on the direction of the message. // Dispatching depends on the direction of the message.
if (outgoing_.has_stream(x.sid)) { if (outgoing_.has_stream(x.sid)) {
outgoing_(x); outgoing_(x);
...@@ -299,13 +300,13 @@ void middleman::start() { ...@@ -299,13 +300,13 @@ void middleman::start() {
return {}; return {};
}, },
[=](sys_atom, stream_msg& x) -> delegated<message> { [=](sys_atom, stream_msg& x) -> delegated<message> {
// Stream message received from a proxy, always results in a new CAF_LOG_TRACE(CAF_ARG(x));
// stream from a local actor to a remote node. // Stream message received from a proxy
CAF_ASSERT(holds_alternative<stream_msg::open>(x.content));
outgoing_(x); outgoing_(x);
return {}; return {};
}, },
[=](sys_atom, ok_atom, int32_t credit) { [=](sys_atom, ok_atom, int32_t credit) {
CAF_LOG_TRACE(CAF_ARG(credit));
CAF_ASSERT(current_mailbox_element() != nullptr); CAF_ASSERT(current_mailbox_element() != nullptr);
auto cme = current_mailbox_element(); auto cme = current_mailbox_element();
if (cme->sender != nullptr) { if (cme->sender != nullptr) {
...@@ -316,16 +317,19 @@ void middleman::start() { ...@@ -316,16 +317,19 @@ void middleman::start() {
} }
}, },
[=](exit_msg& x) { [=](exit_msg& x) {
CAF_LOG_TRACE(CAF_ARG(x));
if (x.reason) if (x.reason)
quit(x.reason); quit(x.reason);
}, },
// Connects both incoming_ and outgoing_ to nid. // Connects both incoming_ and outgoing_ to nid.
[=](connect_atom, const node_id& nid) { [=](connect_atom, const node_id& nid) {
CAF_LOG_TRACE(CAF_ARG(nid));
send(basp_, forward_atom::value, nid, atom("ConfigServ"), send(basp_, forward_atom::value, nid, atom("ConfigServ"),
make_message(get_atom::value, atom("StreamServ"))); make_message(get_atom::value, atom("StreamServ")));
}, },
// Assumes `ptr` is a remote spawn server. // Assumes `ptr` is a remote spawn server.
[=](strong_actor_ptr& ptr) { [=](strong_actor_ptr& ptr) {
CAF_LOG_TRACE(CAF_ARG(ptr));
if (ptr) { if (ptr) {
add_remote_path(ptr->node(), ptr); add_remote_path(ptr->node(), ptr);
} }
...@@ -334,6 +338,7 @@ void middleman::start() { ...@@ -334,6 +338,7 @@ void middleman::start() {
} }
strong_actor_ptr remote_stream_serv(const node_id& nid) override { strong_actor_ptr remote_stream_serv(const node_id& nid) override {
CAF_LOG_TRACE(CAF_ARG(nid));
strong_actor_ptr result; strong_actor_ptr result;
// Ask remote config server for a handle to the remote spawn server. // Ask remote config server for a handle to the remote spawn server.
scoped_actor self{system()}; scoped_actor self{system()};
......
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