#include <toast/async/thread_specific_request_queue.hpp>
Worker threads within this framework process their thread_specific_request_queue as part of their main loop. When you call worker::push, this queue is where you're actually pushing to. When you call make_request the result of the made request will be put on the thread_specific_request_queue for the thread that called make_request.
Static Public Member Functions | |
static boost::function< void(std::list < request > &)> | get_push () |
returns the function for pushing requests on to the queue | |
static void | pop_one (std::list< request > &) |
gets the next item in the queue and puts it in your list | |
static void | pop (std::list< request > &) |
gets all items in the queue and puts them in your list | |
static boost::function< void()> | on_push (boost::function< void()> const &) |
set the callback for notification of new items on the queue |
boost::function< void(std::list< request > &)> toast::async::thread_specific_request_queue::get_push | ( | ) | [static] |
returns the function for pushing requests on to the queue
This function can then be passed to other threads to be able to receive requests from them. There is no simple push because it doesn't make a whole lot of sense for a thread to send itself a request, although in the case you need to, you can just get the function and call it.
References toast::singleton_helper< T, HolderType, FactoryType, Enable >::instance().
Referenced by toast::async::make_request().
static void toast::async::thread_specific_request_queue::pop_one | ( | std::list< request > & | ) | [static] |
gets the next item in the queue and puts it in your list
If there are no items in the queue your list will remain unchanged.
void toast::async::thread_specific_request_queue::pop | ( | std::list< request > & | l | ) | [static] |
gets all items in the queue and puts them in your list
If there are no items in the queue your list will remain unchanged.
References toast::singleton_helper< T, HolderType, FactoryType, Enable >::instance().
boost::function< void()> toast::async::thread_specific_request_queue::on_push | ( | boost::function< void()> const & | f | ) | [static] |
set the callback for notification of new items on the queue
this must be callable from another thread there may only be one callback set, new calls override the old. the old callback function will be returned.
References toast::singleton_helper< T, HolderType, FactoryType, Enable >::instance().