_dispatch(:hello)     # Group/hack request.
   _dispatch(:hello?)    # Help request.
424117
def _dispatch(request, *args)
      raise ArgumentError, "Invalid request #{request.inspect}" if not request.to_s =~ /\A(#{Node::NAME_REGEXP})(\?{,1})\z/
      node_name = $1.to_sym
      is_question = ($2 != "")

      node = @instance.find_local_node(node_name, @parent)

      # NOTE: Method return result.
      if node
        if is_question
          # Help request.
          out = [
            node.brief_desc || @instance.conf.brief_desc_stub,
            (["", node.full_desc] if node.full_desc),
          ].flatten(1).compact

          # `out` are lines of text, eventually.
          ::Kernel.puts out.empty?? "No description, please provide one" : out

          # For groups list contents after description.
          #if node.is_a? Node::Group
          #  ::Kernel.puts ["", self.class.new(@instance, node).inspect]
          #end
        else
          # Group/hack request.
          case node
          when Node::Group
            # Create and return a new nested access context.
            self.class.new(@instance, node)
          when Node::Hack
            # Invoke hack in the context of `HackTree` instance.
            @instance.instance_exec(*args, &node.block)
          else
            raise "Unknown node class #{node.class}, SE"
          end
        end # if is_question
      else
        ::Kernel.puts "Node not found: '#{node_name}'"
      end
    end
415095
def prepare_dispatches(cls, message, recipients=None):
        
        return Dispatch.create(message, recipients or cls.get_subscribers())
953305
def method_missing msg, *args, &block
      if data.respond_to?(msg)
        data.__send__(msg, *args, &block)
      else
        super(msg, *args, &block)
      end
    end
313380
def dispatch(self, request, *args, **kwargs):
        """"""
        if False:  # TODO do permission check based on Model
            raise PermissionDenied
        return super().dispatch(request, *args, **kwargs)
727545
def call(self, **data):
        
        uri, body, headers = self.prepare(data)
        return self.dispatch(uri, body, headers)
165398
public static function dispatch()
    {
        $uri = strtok($_SERVER["REQUEST_URI"],'?');
        $qs = parse_url($_SERVER["REQUEST_URI"], PHP_URL_QUERY);
        $method = $_SERVER['REQUEST_METHOD'];
        
        
        foreach (self::$routes as $name=>$route) {


            $route  = self::parsePattern($route);

            $matched = array();
            if ($route=='' || preg_match('#' . $route . '#', $uri, $matched) && (self::$methods[$name] == 'ANY' || self::$methods[$name] == $method)) {
                
                array_shift($matched);

                if (self::$qs[$name]!='' && preg_match('#' . self::$qs[$name] . '#', $qs, $qsmatched)) {

                    array_shift($qsmatched);

                    $matched = array_merge($matched, $qsmatched);
                    self::$catched[] = $name;
                    BurpEvent::listen($name, self::$callbacks[$name]);
                    BurpEvent::queue($name, $matched);

                } elseif (self::$qs[$name] == '') {
                    self::$catched[] = $name;
                    BurpEvent::listen($name, self::$callbacks[$name]);
                    BurpEvent::queue($name, $matched);
                }
            }

        }

        //call missing if needed
        if (!is_null(self::$missing_callback) ) {
            $diff = array_diff(self::$tocatch, self::$catched);
            if (count($diff) >= count(self::$tocatch)) {
                call_user_func(self::$missing_callback);
                BurpEvent::listen('missing', self::$callbacks[$name]);
                BurpEvent::fire('missing');

            }

        }

        BurpEvent::flushAll();
    }
775790
def do_threaded_dispatch(participant, msg)

      msg = Rufus::Json.dup(msg)
        #
        # the thread gets its own copy of the message
        # (especially important if the main thread does something with
        # the message 'during' the dispatch)

      # Maybe at some point a limit on the number of dispatch threads
      # would be OK.
      # Or maybe it's the job of an extension / subclass

      Thread.new { do_dispatch(participant, msg) }
    end
1043282
def _dispatch(self, method, params):
        """"""
        self._count += 1

        func = getattr(self, method)
        try:
            return func(*params)
        except Exception as e:
            traceback.print_exc()
            raise e
1158572
def _dispatch(self, textgroup, directory):
        
        self.dispatcher.dispatch(textgroup, path=directory)
743963
def do_dispatch(participant, msg)

      do_raw_dispatch(participant, msg)

    rescue => err
      @context.error_handler.msg_handle(msg, err)
    end
284992
def dispatch(self, request, *args, **kwargs):
        """"""
        self.request = DownstreamRequest(request)
        self.args = args
        self.kwargs = kwargs

        self._verify_config()

        self.middleware = MiddlewareSet(self.proxy_middleware)

        return self.proxy()
690078
async def dispatch_request(
        self, request_context: Optional[RequestContext]=None,
    ) -> ResponseReturnValue:
        
        request_ = (request_context or _request_ctx_stack.top).request
        if request_.routing_exception is not None:
            raise request_.routing_exception

        if request_.method == 'OPTIONS' and request_.url_rule.provide_automatic_options:
            return await self.make_default_options_response()

        handler = self.view_functions[request_.url_rule.endpoint]
        return await handler(**request_.view_args)
1164181
def dispatch(self, request, *args, **kwargs):
        '''
        
        '''
        self.request = request
        in_group = False
        required_group = self.get_group_required()
        if not required_group or required_group == ['']:
            in_group = True
        elif self.request.user.is_authenticated():
            in_group = self.check_membership(required_group)

        if not in_group:
            if self.raise_exception:
                raise PermissionDenied
            else:
                return redirect_to_login(
                    request.get_full_path(),
                    self.get_login_url(),
                    self.get_redirect_field_name())
        return super(GroupRequiredMixin, self).dispatch(
            request, *args, **kwargs)
1311948
def dispatch_cgi(request, cgi)
			result = @target.run( request, cgi )
			result.headers.reject!{|k,v| k.to_s.downcase == "status" }
			result.to_a
		end
695850
def dispatch_request(self, *args, **kwargs):
        """"""
        method = getattr(self, request.method.lower(), None)
        if method is None and request.method == 'HEAD':
            method = getattr(self, 'get', None)
        assert method is not None, 'Unimplemented method {}'.format(request.method)

        headers = {'Content-Type': 'application/vnd.api+json'}

        response = method(*args, **kwargs)

        if isinstance(response, Response):
            response.headers.add('Content-Type', 'application/vnd.api+json')
            return response

        if not isinstance(response, tuple):
            if isinstance(response, dict):
                response.update({'jsonapi': {'version': '1.0'}})
            return make_response(json.dumps(response, cls=JSONEncoder), 200, headers)

        try:
            data, status_code, headers = response
            headers.update({'Content-Type': 'application/vnd.api+json'})
        except ValueError:
            pass

        try:
            data, status_code = response
        except ValueError:
            pass

        if isinstance(data, dict):
            data.update({'jsonapi': {'version': '1.0'}})

        return make_response(json.dumps(data, cls=JSONEncoder), status_code, headers)
302084
def whoami(self):
        
        def cbWhoAmI(result):
            return result['address']
        return self.callRemote(WhoAmI).addCallback(cbWhoAmI)
563594
def dispatch(self, *args, **kwargs):
        
        called_handlers = set()
        for handler_list in self.handlers.values():
            for handler, argspec in handler_list:
                accept_args, accept_kwargs = argspec.accepts
                if handler in called_handlers and False:
                    continue
                else:
                    if args_match(accept_args, accept_kwargs, self.default, *args, **kwargs):
                        called_handlers.add(handler)
                        handler(*args, **kwargs)
        
        return called_handlers