Open robertmaynard opened 10 years ago
PR #198 Shows how to make a boost worker pool, while it doesn't allow registering of custom worker types, it would be fairly easy to add. So instead of having a QtWorkerPollFactory example, lets make it a boost ThreadPoolWorkerFactory.
Create a derived WorkerFactory, that uses the boost thread and asio to create a pool of threads and assign them to workers.
We will need to have an api that allows users to easily register workers for the pool to use. The key is that the pool will want to have a single server connection it passes to the users bound function.
So we need something like:
where
WorkerLauncher
is a bound function with the following signature