00001 #ifndef toast_async_worker_pool_hpp_INCLUDED
00002 #define toast_async_worker_pool_hpp_INCLUDED
00003 
00004 #include <boost/scoped_ptr.hpp>
00005 #include <boost/shared_ptr.hpp>
00006 #include <toast/async/worker.hpp>
00007 #include <toast/async/request.hpp>
00008 
00009 namespace toast {
00010 namespace async {
00011 
00027 class worker_pool
00028 {
00029   struct impl;
00030   boost::scoped_ptr<impl> impl_;
00031 public:
00033   worker_pool(int number_of_workers, bool complete = false);
00034   ~worker_pool();
00035 
00041   void push(request const &);
00042 
00048   void push(std::list<request> &);
00049 };
00050 
00052 void init_default_worker_pool(int number_of_workers, bool complete = false);
00053 
00061 worker_pool &default_worker_pool();
00062 
00065 } 
00066 } 
00067 
00068 #endif // toast_async_worker_pool_hpp_INCLUDED