def route!(command, aggregate_id, options = {}, **data)
      handler = @routes[command]
      case handler
      when Class
        transactor = options.fetch(:transactor, default_transactor)
        transactor.call(handler, command, aggregate_id, options, **data)
      when handler.respond_to?(:call)
        handler.call(command, aggregate_id, options, **data)
      when Proc
        handler.call(command, aggregate_id, options, **data)
      when nil
        raise HandlerNotFoundError, "Handler for command #{command.inspect} not found"
      else
        raise UnsupportedHandlerError, "Unsupported command handler #{handler.inspect}"
      end
    end
def route!(command, aggregate_id, options = {}, **data)
      handler = @routes[command]
      case handler
      when Class
        transactor = options.fetch(:transactor, default_transactor)
        transactor.call(handler, command, aggregate_id, options, **data)
      when handler.respond_to?(:call)
        handler.call(command, aggregate_id, options, **data)
      when Proc
        handler.call(command, aggregate_id, options, **data)
      when nil
        raise HandlerNotFoundError, "Handler for command #{command.inspect} not found"
      else
        raise UnsupportedHandlerError, "Unsupported command handler #{handler.inspect}"
      end
    end
Routes a command to the registered target.
 Raises `NotFoundError` if no corresponding target can be found.

 Arguments:
   - command - name of the command
   - aggregate_id - aggregate id
   - options - flags:
     - transactor - transactor instance to replace the default one (`OptimisticTransactor`);
   See docs for `OptimisticTransactor` for a list of additional supported options.