'Run the foreman on the client.'

def ProcessMessage(self, message):

    if (message.auth_state != rdf_flows.GrrMessage.AuthorizationState.AUTHENTICATED):
        return
    now = time.time()
    with self.lock:
        if ((self.foreman_cache is None) or (now > (self.foreman_cache.age + self.cache_refresh_time))):
            self.foreman_cache = aff4.FACTORY.Open('aff4:/foreman', mode='rw', token=self.token)
            self.foreman_cache.age = now
    if message.source:
        self.foreman_cache.AssignTasksToClient(message.source)
