Added support for assigning tasks to queues.