|
TL;DR: want to use a function that returns the result as a callback, and then return that value to the next operator. I am pretty sure this won't work because the asio token is lazy and the rpp operator is eager. Or is it? I have a callback interface from a class that is invoked every time a message arrives on a socket. I used the code below to hook the event emitter to the observable. This is working just fine for the case of: What I would like to do next is dispatch this to an async call that returns an asio completion token type. I would like to extract that result and then pass it on to the next stage of the pipeline. Something like: |
Replies: 2 comments 5 replies
|
Sorry, i don't have a lot of experience with asio especially new things related to tokens and etc. Could you provide more detailed or abstract example? auto obs = ...;
obs.observer_on(rpp::scheduler::new_thread{}).
.map([](auto msg) { .... std::this_thread::sleep_for(std::chrono::seconds{10}); return msg.get_value(); })
.subscribe.... |
|
TL;DR: map+concat is the answer =) |
TL;DR: map+concat is the answer =)