mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-05 08:48:03 +00:00
Add ServiceQueue::wrap
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
#include "ThreadLocalValue.h"
|
||||
#include "WaitableEvent.h"
|
||||
|
||||
#include "detail/DispatchedHandler.h"
|
||||
|
||||
namespace beast {
|
||||
|
||||
namespace detail {
|
||||
@@ -518,6 +520,15 @@ public:
|
||||
ItemType <Handler> (BEAST_MOVE_CAST(Handler)(handler)));
|
||||
}
|
||||
|
||||
/** Return a new handler that dispatches the wrapped handler on the queue. */
|
||||
template <typename Handler>
|
||||
detail::DispatchedHandler <ServiceQueueType&, Handler> wrap (
|
||||
BEAST_MOVE_ARG(Handler) handler)
|
||||
{
|
||||
return detail::DispatchedHandler <ServiceQueueType&, Handler> (
|
||||
*this, BEAST_MOVE_CAST(Handler)(handler));
|
||||
}
|
||||
|
||||
/** Run the event loop to execute ready handlers.
|
||||
This runs handlers that are ready to run, without blocking, until
|
||||
there are no more handlers ready or the service queue has been stopped.
|
||||
|
||||
Reference in New Issue
Block a user