Wraps the call to do_dispatch in a thread.
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
1343022
function(view, event_name, event_object, targets) {

		this._dispatchCallback(
			view,
			targets,
			this._callHandleEvent,
			{
				event_name: event_name,
				event_object: event_object
			},
			this._global_event_targets
		);

	}
426450
def dispatch(self, receiver):
        ''' 

        '''
        super(DocumentPatchedEvent, self).dispatch(receiver)
        if hasattr(receiver, '_document_patched'):
            receiver._document_patched(self)
426997
async def dispatch(self, request, **kwargs):
        """"""
        # Authorize request
        self.auth = await self.authorize(request)

        # Load collection
        self.collection = await self.load_many(request)

        # Load resource
        self.resource = await self.load_one(request)

        if request.method == 'GET' and self.resource is None:

            # Filter collection
            self.collection = await self.filter(request)

            # Sort collection
            self.columns_sort = request.query.get('ap-sort', self.columns_sort)
            if self.columns_sort:
                reverse = self.columns_sort.startswith('-')
                self.columns_sort = self.columns_sort.lstrip('+-')
                self.collection = await self.sort(request, reverse=reverse)

            # Paginate collection
            try:
                self.offset = int(request.query.get('ap-offset', 0))
                if self.limit:
                    self.count = await self.count(request)
                    self.collection = await self.paginate(request)
            except ValueError:
                pass

        return await super(AdminHandler, self).dispatch(request, **kwargs)
482970
def dispatch(self, *args, **kwargs):
        """"""
        action = kwargs.pop('action', 'default')
        action_method = getattr(self, str(action), self.default)
        return action_method(*args, **kwargs)
299344
def bg_thread(func):
    
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        p = threading.Thread(target=func, args=args, kwargs=kwargs)
        p.start()
    return wrapper
1102874
def dispatch(self):
        """"""
        method_name = 'on_' + self.environ['REQUEST_METHOD'].lower()
        method = getattr(self, method_name, None)
        if method:
            return method()
        else:
            return self.on_bad_method()
253053
def handle_notification(self, msgtype, method, args, kwargs):
        """"""
        self.dispatch.call(method, args, kwargs)
867568
def call(self, name: str, *args, **kwargs):
        ''''''
        if self._event_dispatcher is not None:
            self._event_dispatcher.notify(name, *args, **kwargs)

        if self._callbacks[name]:
            return self._callbacks[name](*args, **kwargs)
        else:
            raise HookDisconnected('No callback is connected.')
595085
public void dispatch(Request request, Response response) throws IOException, ServletException {
        onPreDispatch(request, response);
        onRouteDispatch(request, response);
        onPostDispatch(request, response);
    }
737941
def dispatch(self, *args, **kwargs):
        self.__line_pk = kwargs.get('pk', None)
        
        return super(LinesUpdateModalBasket, self).dispatch(*args, **kwargs)
197543
def dispatch(self, receiver):
        ''' 

        '''
        super(SessionCallbackAdded, self).dispatch(receiver)
        if hasattr(receiver, '_session_callback_added'):
            receiver._session_callback_added(self)
145332
def dispatch(msg)

      participant = @context.plist.lookup(
        msg['participant'] || msg['participant_name'], msg['workitem'])

      if
        @context['participant_threads_enabled'] == false ||
        do_not_thread?(participant, msg)
      then
        do_dispatch(participant, msg)
      else
        do_threaded_dispatch(participant, msg)
      end
    end
181808
def threader(group=None, name=None, daemon=True):
    
    def decorator(job):
        """
        :param job: function to be threaded
        :rtype: wrap
        """
        def wrapped_job(queue, *args, **kwargs):
            """ this function calls the decorated function
            and puts the result in a queue
            :type queue: Queue
            """
            ret = job(*args, **kwargs)
            queue.put(ret)

        def wrap(*args, **kwargs):
            """ this is the function returned from the decorator. It fires off
            wrapped_f in a new thread and returns the thread object with
            the result queue attached
            :rtype: Thread
            """
            thread = Thread(group=group, target=wrapped_job, name=name, args=args, kwargs=kwargs, daemon=daemon)
            thread.start()
            return thread
        return wrap
    return decorator
935455
function Dispatcher(req, res, next) {
            _classCallCheck(this, Dispatcher);

            this.req = req;
            this.res = res;
            this.next = next;
         }
339969
def request(self, msgtype, msgid, method, params=[]):
        """"""
        result = None
        error = None
        exception = None

        try:
            result = self.dispatch.call(method, params)
        except Exception as e:
            error = (e.__class__.__name__, str(e))
            exception = e

        if isinstance(result, Deferred):
            result.add_callback(self._result, msgid)
            result.add_errback(self._error, msgid)
        else:
            self.send_response(msgid, error, result)
198730
def __postCallAction(self, event):
        
        aThread = event.get_thread()
        retval  = self._get_return_value(aThread)
        self.__callHandler(self.__postCB, event, retval)