def register_task(self, task, callback_function):
    'Register a function with this worker\n\n        def function_callback(calling_gearman_worker, current_job):\n            return current_job.data\n        '
    self.worker_abilities[task] = callback_function
    self._update_initial_state()
    for command_handler in self.handler_to_connection_map.keys():
        command_handler.set_abilities(self.handler_initial_state['abilities'])
    return task
Register a function with this worker

def function_callback(calling_gearman_worker, current_job):
    return current_job.data
def register_task(self, task, callback_function):
    'Register a function with this worker\n\n        def function_callback(calling_gearman_worker, current_job):\n            return current_job.data\n        '
    self.worker_abilities[task] = callback_function
    self._update_initial_state()
    for command_handler in self.handler_to_connection_map.keys():
        command_handler.set_abilities(self.handler_initial_state['abilities'])
    return task