Esempio n. 1
0
 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_));
 }
Esempio n. 2
0
 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_));
 }
Esempio n. 3
0
 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_));
 }
Esempio n. 4
0
 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_)));
 }
Esempio n. 5
0
 void unordered(Handler&& handler, Args&&... args)
 {
     service_.post(strand_.wrap(inject(BIND_HANDLER(handler, args),
         UNORDERED, unordered_)));
 }
Esempio n. 6
0
 void ordered(Handler&& handler, Args&&... args)
 {
     strand_.post(inject(BIND_HANDLER(handler, args), ORDERED, ordered_));
 }
Esempio n. 7
0
 void concurrent(Handler&& handler, Args&&... args)
 {
     service_.post(inject(BIND_HANDLER(handler, args), CONCURRENT,
         concurrent_));
 }
Esempio n. 8
0
 static void bound(Handler&& handler, Args&&... args)
 {
     BIND_HANDLER(handler, args)();
 }
Esempio n. 9
0
static void _handlers_init(std::map<bref::request_methods::Type, RequestHanderFunctor> &_handlers) {
	_handlers[bref::request_methods::Get] = BIND_HANDLER(&request_handler_get);
}