Invoked once by the thread associated with the dispatcher. Handles
all events from the underlying {@link Selector}.
327922
@Override
    @SuppressWarnings({ "PMD.EmptySynchronizedBlock", "PMD.EmptyCatchBlock",
        "PMD.AvoidCatchingThrowable" })
    public void run() {
        try {
            registerAsGenerator();
            while (!Thread.currentThread().isInterrupted()) {
                try {
                    selector.select();
                    Set<SelectionKey> selected = selector.selectedKeys();
                    for (SelectionKey key : selected) {
                        ((NioHandler) key.attachment())
                            .handleOps(key.readyOps());
                    }
                    selected.clear();
                    synchronized (selectorGate) {
                        // Delay next iteration if another thread has the lock.
                        // "Find bugs" complains, but this is really okay.
                    }
                } catch (InterruptedIOException | InterruptedException
                        | Error e) {
                    break;
                } catch (Throwable e) {
                    // Ignore anything else, this loop is crucial.
                }
            }
        } finally {
            unregisterAsGenerator();
        }
    }
275913
public synchronized EventBus once(Class<? extends EventObject> eventType, OnceEventListenerBase listener) {
        if (null != onceBus) {
            onceBus.bind(eventType, listener);
        } else {
            bind(eventType, listener);
        }
        return this;
    }
462228
public void start()
    {
        Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Cannot be started more than once");

        service.submit
            (
                new Callable<Object>()
                {
                    @Override
                    public Object call() throws Exception
                    {
                        processEvents();
                        return null;
                    }
                }
            );
    }
265426
public void onResume(Object view) {
        getPresenter();
        if (presenter != null && !presenterHasView) {
            //noinspection unchecked
            presenter.takeView(view);
            presenterHasView = true;
        }
    }
1143501
def once(self, event, callback):
        ''
        self._once_events.add(event)
        self.on(event, callback)
303514
public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) {
        AdapterDelegate<T> delegate = getDelegateForViewType(holder.getItemViewType());
        if (delegate == null) {
            throw new NullPointerException("No delegate found for "
                    + holder
                    + " for item at position = "
                    + holder.getAdapterPosition()
                    + " for viewType = "
                    + holder.getItemViewType());
        }
        delegate.onViewRecycled(holder);
    }
651398
private void handleRequest(long requestId, Object request, HandlerHolder handler) {
    @SuppressWarnings("unchecked")
    CompletableFuture<Object> responseFuture = handler.handler.apply(request);
    if (responseFuture != null) {
      responseFuture.whenComplete((response, error) -> {
        ThreadContext context = ThreadContext.currentContext();
        if (context == null) {
          this.context.executor().execute(() -> {
            if (error == null) {
              handleRequestSuccess(requestId, response, this.context);
            } else {
              handleRequestFailure(requestId, error, this.context);
            }
          });
        } else {
          if (error == null) {
            handleRequestSuccess(requestId, response, context);
          } else {
            handleRequestFailure(requestId, error, context);
          }
        }
      });
    }
  }
717921
def run_once(self):
        
        self._capture_signals()
        self._start_monitor()
        try:
            self._run_worker()
        except KeyboardInterrupt:
            return
        finally:
            self._stop_monitor()
            self._restore_signals()
551196
@EventListener
    public void init(ContextRefreshedEvent event) {
        idTokenFactory = context.getBean(IdTokenFactory.class);

        // Make sure we have a guestUsernameSelectors collection & sort it
        if (guestUsernameSelectors == null) {
            guestUsernameSelectors = Collections.emptyList();
        }
        Collections.sort(guestUsernameSelectors);
    }
544393
public void reuse(Tag handler) {
        synchronized( this ) {
            if (current < (handlers.length - 1)) {
                handlers[++current] = handler;
                return;
            }
        }
        // There is no need for other threads to wait for us to release
        handler.release();
    }
934002
@Override
    public void onNext(final T t) {

        Objects.requireNonNull(t);
        counter.added++;
        queue.add(t);





    }
649190
def once(self, event: str, *handlers: T.Callable) -> T.Callable:
        """"""

        def _once_wrapper(*handlers: T.Callable) -> T.Callable:
            """Wrapper for 'once' decorator"""

            def _wrapper(*args: T.Any, **kw: T.Any) -> None:
                """Wrapper that unregisters itself before executing
                the handlers"""

                self.off(event, _wrapper)
                for handler in handlers:
                    handler(*args, **kw)

            return _wrapper

        if handlers:
            return self.on(event, _once_wrapper(*handlers))
        return lambda x: self.on(event, _once_wrapper(x))
134349
public synchronized void fire(T event) {
		if (occured) throw new IllegalStateException("SingleEvent already fired");
		occured = true;
		data = event;
		if (listeners != null) {
			for (Listener<T> listener : listeners)
				listener.fire(event);
			listeners = null;
		}
		if (listenersRunnable != null) {
			for (Runnable listener : listenersRunnable)
				listener.run();
			listenersRunnable = null;
		}
	}
793955
private void onHandlerEntry() {
        if (enabled) {
            Type exceptionType = handlers.get(handlerPendingInstruction);

            // Clear the pending instruction flag
            handlerPendingInstruction = null;

            // Filter the interested down to this exception
            Set<ProbeListener> filtered = new HashSet<ProbeListener>();
            for (ProbeListener listener : enabledListeners) {
                ListenerConfiguration config = listener.getListenerConfiguration();
                ProbeFilter filter = config.getTransformerData(EXCEPTION_FILTER_KEY);
                if (filter.isBasicFilter() && filter.basicClassNameMatches(exceptionType.getClassName())) {
                    filtered.add(listener);
                } else if (filter.isAdvancedFilter()) {
                    Class<?> clazz = getOwningClass(exceptionType.getInternalName());
                    if (clazz != null && filter.matches(clazz)) {
                        filtered.add(listener);
                    }
                }
            }

            if (filtered.isEmpty()) {
                return;
            }

            String key = createKey(exceptionType);
            ProbeImpl probe = getProbe(key);
            long probeId = probe.getIdentifier();

            setProbeInProgress(true);
            visitInsn(DUP); // throwable throwable
            visitLdcInsn(Long.valueOf(probeId)); // throwable throwable long1 long2
            visitInsn(DUP2_X1); // throwable long1 long2 throwable long1 long2
            visitInsn(POP2); // throwable long1 long2 throwable
            if (isStatic()) {
                visitInsn(ACONST_NULL); // throwable long1 long2 throwable this
            } else {
                visitVarInsn(ALOAD, 0); // throwable long1 long2 throwable this
            }
            visitInsn(SWAP); // throwable long1 long2 this throwable
            visitInsn(ACONST_NULL); // throwable long1 long2 this throwable null
            visitInsn(SWAP); // throwable long1 long2 this null throwable
            visitFireProbeInvocation(); // throwable
            setProbeInProgress(false);

            setProbeListeners(probe, filtered);
        }
    }
472679
def once(event, &block)
      add_listener(event) do |*args, &callback|
        block.call(*args, &callback)
        :delete
      end
    end
879597
void onRendererSelected() {
        if (view.getRendererSelected() != null) {
            rendererLibrary = rendererManager.getRendererByName(view.getRendererSelected());
            selectCommand.execute();
        }
    }
565192
public function onDispatcherReady()
    {
        if ($this->dispatcher && $this->dispatcher->isReady()) {
            $context = $this->currentContext;
            $event = $this->currentEvent;
            $this->dispatcher = null;
            $this->currentContext = null;
            $this->currentEvent = null;
            $this->doCheckTransitions($context, $event);
            $this->mutex->releaseLock();
        }
    }