def slow_operation(): def calc_value(value): return 42 return task.deferLater(reactor, 1, calc_value, None)