def handle_callback(hook, event, *data)
      to = machine.events_map.move_to(event.event_name, event.from, *data)
      trans_event = TransitionEvent.new(event.event_name, event.from, to)
      callable    = create_callable(hook)

      if hook.is_a?(Async)
        defer(callable, trans_event, *data)
      else
        callable.(trans_event, *data)
      end
    end
def handle_callback(hook, event, *data)
      to = machine.events_map.move_to(event.event_name, event.from, *data)
      trans_event = TransitionEvent.new(event.event_name, event.from, to)
      callable    = create_callable(hook)

      if hook.is_a?(Async)
        defer(callable, trans_event, *data)
      else
        callable.(trans_event, *data)
      end
    end
Handle callback and decide if run synchronously or asynchronously

 @param [Proc] :hook
   The hook to evaluate

 @param [HookEvent] :event
   The event for which the hook is called

 @param [Array[Object]] :data

 @api private