'Constructor for the Hunt Runner.
Args:
hunt_obj: The hunt object this runner will run states for.
runner_args: A HuntRunnerArgs() instance containing initial values. If not
specified, we use the runner_args from the hunt_obj.
token: An instance of access_control.ACLToken security token.'

def __init__(self, hunt_obj, runner_args=None, token=None):

    self.token = (token or hunt_obj.token)
    self.queue_manager = queue_manager.QueueManager(token=self.token)
    self.outbound_lock = threading.Lock()
    self.hunt_obj = hunt_obj
    if (runner_args is not None):
        self.runner_args = runner_args
        self.session_id = self.GetNewSessionID()
        self.hunt_obj.urn = self.session_id
        self.context = self.InitializeContext(runner_args)
        self.hunt_obj.context = self.context
        self.context.session_id = self.session_id
    else:
        self.context = self.hunt_obj.context
        self.runner_args = self.hunt_obj.runner_args
    self.hunt_obj.urn = self.session_id = self.context.session_id
