It would be nice to have an equivalent of any_completion_handler where the handler can be invoked multiple times. A real-life use case is a user-registered RPC handler in a middleware library, where the user wants to specify an executor via which the RPC should be posted.
It would be preferable if such a multi-shot handler were copyable, the same way as std::function is copyable.
It would be nice to have an equivalent of
any_completion_handler
where the handler can be invoked multiple times. A real-life use case is a user-registered RPC handler in a middleware library, where the user wants to specify an executor via which the RPC should be posted.It would be preferable if such a multi-shot handler were copyable, the same way as
std::function
is copyable.For now, I've hacked something that combines a
std::function
along with anany_completion_executor
: https://github.com/ecorm/cppwamp/blob/ae2d929fef3703531343a71a4d8f41d15d916daa/cppwamp/include/cppwamp/anyhandler.hpp#L68