void ordered(Handler&& handler, Args&&... args) { // Use a strand to prevent concurrency and post vs. dispatch to ensure // that the job is not executed in the current thread. strand_.post(BIND_HANDLER(handler, args)); ////strand_.post(inject(BIND_HANDLER(handler, args), ORDERED, ordered_)); }
void concurrent(Handler&& handler, Args&&... args) { // Service post ensures the job does not execute in the current thread. service_.post(BIND_HANDLER(handler, args)); ////service_.post(inject(BIND_HANDLER(handler, args), CONCURRENT, //// concurrent_)); }
void lock(Handler&& handler, Args&&... args) { // Use a sequence to track the asynchronous operation to completion, // ensuring each asynchronous op executes independently and in order. sequence_.lock(BIND_HANDLER(handler, args)); ////sequence_.lock(inject(BIND_HANDLER(handler, args), SEQUENCE, //// sequence_)); }
void unordered(Handler&& handler, Args&&... args) { // Use a strand wrapper to prevent concurrency and a service post // to deny ordering while ensuring execution on another thread. service_.post(strand_.wrap(BIND_HANDLER(handler, args))); ////service_.post(strand_.wrap(inject(BIND_HANDLER(handler, args), //// UNORDERED, unordered_))); }
void unordered(Handler&& handler, Args&&... args) { service_.post(strand_.wrap(inject(BIND_HANDLER(handler, args), UNORDERED, unordered_))); }
void ordered(Handler&& handler, Args&&... args) { strand_.post(inject(BIND_HANDLER(handler, args), ORDERED, ordered_)); }
void concurrent(Handler&& handler, Args&&... args) { service_.post(inject(BIND_HANDLER(handler, args), CONCURRENT, concurrent_)); }
static void bound(Handler&& handler, Args&&... args) { BIND_HANDLER(handler, args)(); }
static void _handlers_init(std::map<bref::request_methods::Type, RequestHanderFunctor> &_handlers) { _handlers[bref::request_methods::Get] = BIND_HANDLER(&request_handler_get); }