Execute events that have been queued since cork() was called
@chainable
194311
public function uncork()
    {
        $this->_corked = false;

        while ($call = array_shift($this->_queue)) {
            call_user_func_array(array($this,'trigger'), $call);
        }

        return $this;
    }
790447
def _handle_event(self, connection, event):
        
        with self.mutex:
            matching_handlers = sorted(
                self.handlers.get("all_events", [])
                + self.handlers.get(event.type, [])
            )
            for handler in matching_handlers:
                result = handler.callback(connection, event)
                if result == "NO MORE":
                    return
595370
function() {
			try {
				if (fn) {
					/**
					 * Insert a done() or ok() argument to other needed arguments
					 */
					syntheticArgs.unshift(function() {
						/**
						 * Call the next in queue
						 */
						$this.next.apply($this, arguments);
					});
					/**
					 * Call the function finally
					 */
					fn.apply(this, syntheticArgs);
				} else {
					syntheticArgs = syntheticArgs || [];
					/**
					 * If no function passed, call the next in queue
					 */
					$this.next.apply(this, syntheticArgs);
				}
			} catch(e) {
				/**
				 * An error caught is thrown directly to the catch handler, if any
				 */
				if (this.onCatch) {
					this.onCatch(e);
				} else {
					throw e;
				}
			}
		}
405221
def process_events
      until @dead
        @mutex.synchronize do
          while @queue.empty?
            break if @dead
            @not_empty.wait(@mutex)
          end
          event = @queue.pop
          break unless event
          notify_listeners(event)
          event.dispatch
        end
      end
    rescue Exception => ex
      Logger.error "Error while running event: #{Logger.format_error(ex)}"
    end
160180
public function run($commands, Closure $callback = null)
    {
        foreach ($this->connections as $connection) {
            $connection->run($commands, $callback);
        }
    }
118787
def __flush_eventqueue(self):
        """"""
        while self.eventqueue:
            past_event = self.eventqueue.pop(0)
            self.postprocess_keyevent(past_event)
909730
function trigger(event, a, b) {
    listeners[event].forEach(function(handler) {
      handler.call(instance, a, b);
    });
  }
622673
function(){
                if (executionChainDone){
                    console.log('execution done !!!')
                    return;
                }
                if (i >= _middleware.length){

                    fn(request,response);
                }
                else{
                    mf = _middleware[i];
                    i++;
                    mf(request,response,next);
                }
            }
668757
protected function executeCallback()
    {
        if ($this->muted) {
            return $this->executeMutedCallback();
        }

        $this->result->setValue(call_user_func_array($this->callback, $this->params));
    }
278518
def process_events(self):
        """"""
        for event, args in iter_except(self.event_queue.popleft, IndexError):
            for callback in self.event_callbacks[event]:
                callback(*args)
117510
def run(self):
        ''''''
        # We left-append rather than emit (right-append) because some message
        # may have been already queued for execution before the director runs.
        global_event_queue.appendleft((INITIATE, self, (), {}))
        while global_event_queue:
            self.process_event(global_event_queue.popleft())
1145912
function() {
    // Set `eventQueue` to null before processing it so that we can tell if more
    // events get enqueued while processing.
    var processingEventQueue = eventQueue;
    eventQueue = null;
    forEachAccumulated(processingEventQueue, executeDispatchesAndRelease);
    ("production" !== "development" ? invariant(
      !eventQueue,
      'processEventQueue(): Additional events were enqueued while processing ' +
      'an event queue. Support for this has not yet been implemented.'
    ) : invariant(!eventQueue));
  }
1025994
def process_event(self, event_id):
    """"""
    with db.session.begin_nested():
        event = Event.query.get(event_id)
        event._celery_task = self  # internal binding to a Celery task
        event.receiver.run(event)  # call run directly to avoid circular calls
        flag_modified(event, 'response')
        flag_modified(event, 'response_headers')
        db.session.add(event)
    db.session.commit()
68692
function onLangsLoaded() {
    if (autorun) {
      contentLoaded(
        function () {
          var n = callbacks.length;
          var callback = n ? function () {
            for (var i = 0; i < n; ++i) {
              (function (i) {
                win.setTimeout(
                   function () {
                     win['exports'][callbacks[i]].apply(win, arguments);
                   }, 0);
               })(i);
            }
          } : void 0;
          prettyPrint(callback);
        });
    }
  }
331211
public function executeAction()
    {
        // get event queue id
        $eventQueueId = $this->getRequest()->getParam('event_queue_id');
        $this->_executeEventQueue($eventQueueId);

        // return back to the view
        $this->_redirect('*/*/');
    }
449241
def process_events
      while (event = @_actable.mailbox.obtain_and_shift)
        event_handler(event)
      end

    rescue Exception => exception
      cleanup_handler(exception)
      exception_handler(exception)
    ensure
      @_actable.mailbox.release do
        process_events
      end

      nil
    end
1139639
def trigger_events(events, loop):
    
    for event in events:
        result = event(loop)
        if isawaitable(result):
            loop.run_until_complete(result)