Implementation of tasks queue.
Define a thread pool size on initialization.