Instead of playing the game of casting between stream_event and derived
class. We overload handle_stream_event with derived stream_event class.
virtual void handle_stream_event(session_complete_event event) {}
virtual void handle_stream_event(progress_event event) {}
virtual void handle_stream_event(session_prepared_event event) {}
Also, make the virtual function non pure virtual, so user can override
the interested event only without defining all of the three.
Now stream_result_future can create a stream_coordinator if not
provided.
So
- On sending side, stream_coordinator is created by stream_plan
- On receiving side, stream_coordinator is created by stream_result_future