Commit 97024e8c authored by Dominik Charousset's avatar Dominik Charousset

Add trailing commas for nicer formatting

parent 460a1953
...@@ -58,7 +58,8 @@ void push(std::deque<T>& xs, downstream<T>& out, size_t num) { ...@@ -58,7 +58,8 @@ void push(std::deque<T>& xs, downstream<T>& out, size_t num) {
VARARGS_TESTEE(int_file_reader, size_t buf_size) { VARARGS_TESTEE(int_file_reader, size_t buf_size) {
using buf = std::deque<int32_t>; using buf = std::deque<int32_t>;
return {[=](string& fname) -> result<stream<int32_t>> { return {
[=](string& fname) -> result<stream<int32_t>> {
CAF_CHECK_EQUAL(fname, "numbers.txt"); CAF_CHECK_EQUAL(fname, "numbers.txt");
return attach_stream_source( return attach_stream_source(
self, self,
...@@ -68,15 +69,19 @@ VARARGS_TESTEE(int_file_reader, size_t buf_size) { ...@@ -68,15 +69,19 @@ VARARGS_TESTEE(int_file_reader, size_t buf_size) {
std::iota(xs.begin(), xs.end(), 1); std::iota(xs.begin(), xs.end(), 1);
}, },
// get next element // get next element
[](buf& xs, downstream<int32_t>& out, size_t num) { push(xs, out, num); }, [](buf& xs, downstream<int32_t>& out, size_t num) {
push(xs, out, num);
},
// check whether we reached the end // check whether we reached the end
[=](const buf& xs) { return xs.empty(); }); [=](const buf& xs) { return xs.empty(); });
}}; },
};
} }
VARARGS_TESTEE(string_file_reader, size_t buf_size) { VARARGS_TESTEE(string_file_reader, size_t buf_size) {
using buf = std::deque<string>; using buf = std::deque<string>;
return {[=](string& fname) -> result<stream<string>> { return {
[=](string& fname) -> result<stream<string>> {
CAF_CHECK_EQUAL(fname, "strings.txt"); CAF_CHECK_EQUAL(fname, "strings.txt");
return attach_stream_source( return attach_stream_source(
self, self,
...@@ -86,10 +91,13 @@ VARARGS_TESTEE(string_file_reader, size_t buf_size) { ...@@ -86,10 +91,13 @@ VARARGS_TESTEE(string_file_reader, size_t buf_size) {
xs.emplace_back("some string data"); xs.emplace_back("some string data");
}, },
// get next element // get next element
[](buf& xs, downstream<string>& out, size_t num) { push(xs, out, num); }, [](buf& xs, downstream<string>& out, size_t num) {
push(xs, out, num);
},
// check whether we reached the end // check whether we reached the end
[=](const buf& xs) { return xs.empty(); }); [=](const buf& xs) { return xs.empty(); });
}}; },
};
} }
TESTEE_STATE(sum_up) { TESTEE_STATE(sum_up) {
...@@ -98,7 +106,8 @@ TESTEE_STATE(sum_up) { ...@@ -98,7 +106,8 @@ TESTEE_STATE(sum_up) {
TESTEE(sum_up) { TESTEE(sum_up) {
using intptr = int*; using intptr = int*;
return {[=](stream<int32_t>& in) { return {
[=](stream<int32_t>& in) {
return attach_stream_sink( return attach_stream_sink(
self, self,
// input stream // input stream
...@@ -115,7 +124,8 @@ TESTEE(sum_up) { ...@@ -115,7 +124,8 @@ TESTEE(sum_up) {
[=](join_atom, actor src) { [=](join_atom, actor src) {
CAF_MESSAGE(self->name() << " joins a stream"); CAF_MESSAGE(self->name() << " joins a stream");
self->send(self * src, join_atom::value, ints_atom::value); self->send(self * src, join_atom::value, ints_atom::value);
}}; },
};
} }
TESTEE_STATE(collect) { TESTEE_STATE(collect) {
...@@ -123,7 +133,8 @@ TESTEE_STATE(collect) { ...@@ -123,7 +133,8 @@ TESTEE_STATE(collect) {
}; };
TESTEE(collect) { TESTEE(collect) {
return {[=](stream<string>& in) { return {
[=](stream<string>& in) {
return attach_stream_sink( return attach_stream_sink(
self, self,
// input stream // input stream
...@@ -144,7 +155,8 @@ TESTEE(collect) { ...@@ -144,7 +155,8 @@ TESTEE(collect) {
[=](join_atom, actor src) { [=](join_atom, actor src) {
CAF_MESSAGE(self->name() << " joins a stream"); CAF_MESSAGE(self->name() << " joins a stream");
self->send(self * src, join_atom::value, strings_atom::value); self->send(self * src, join_atom::value, strings_atom::value);
}}; },
};
} }
using int_downstream_manager = broadcast_downstream_manager<int>; using int_downstream_manager = broadcast_downstream_manager<int>;
...@@ -210,7 +222,8 @@ TESTEE_STATE(stream_multiplexer) { ...@@ -210,7 +222,8 @@ TESTEE_STATE(stream_multiplexer) {
TESTEE(stream_multiplexer) { TESTEE(stream_multiplexer) {
self->state.stage = make_counted<fused_stage>(self); self->state.stage = make_counted<fused_stage>(self);
return {[=](join_atom, ints_atom) { return {
[=](join_atom, ints_atom) {
auto& stg = self->state.stage; auto& stg = self->state.stage;
CAF_MESSAGE("received 'join' request for integers"); CAF_MESSAGE("received 'join' request for integers");
auto result = stg->add_unchecked_outbound_path<int>(); auto result = stg->add_unchecked_outbound_path<int>();
...@@ -231,7 +244,8 @@ TESTEE(stream_multiplexer) { ...@@ -231,7 +244,8 @@ TESTEE(stream_multiplexer) {
[=](const stream<string>& in) { [=](const stream<string>& in) {
CAF_MESSAGE("received handshake for strings"); CAF_MESSAGE("received handshake for strings");
return self->state.stage->add_unchecked_inbound_path(in); return self->state.stage->add_unchecked_inbound_path(in);
}}; },
};
} }
struct config : actor_system_config { struct config : actor_system_config {
......
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