'Constructor.
Args:
queues: The queues we use to fetch new messages from.
threadpool_prefix: A name for the thread pool used by this worker.
threadpool_size: The number of workers to start in this thread pool.
token: The token to use for the worker.
Raises:
RuntimeError: If the token is not provided.'

def __init__(self, queues=queues_config.WORKER_LIST, threadpool_prefix='grr_threadpool', threadpool_size=None, token=None):

    logging.info(('started    worker    with    queues:    ' + str(queues)))
    self.queues = queues
    self.queued_flows = utils.TimeBasedCache(max_size=10, max_age=60)
    if (token is None):
        raise RuntimeError('A    valid    ACLToken    is    required.')
    if (self.__class__.thread_pool is None):
        if (threadpool_size is None):
            threadpool_size = config.CONFIG['Threadpool.size']
        self.__class__.thread_pool = threadpool.ThreadPool.Factory(threadpool_prefix, min_threads=2, max_threads=threadpool_size)
        self.__class__.thread_pool.Start()
    self.token = token
    self.last_active = 0
    self.well_known_flows = flow.WellKnownFlow.GetAllWellKnownFlows(token=token)
