Entry point of SelectableObject: register the callback
179626
def wait_return(self, callback):
        """"""
        if self.check_recv():
            return callback(self)
        _t = threading.Thread(target=self._wait_non_ressources, args=(callback,))  # noqa: E501
        _t.setDaemon(True)
        _t.start()
145815
public function activate(): void
    {
        if ($this->stopBuffering) {
            $this->buffering = false;
        }
        if (!$this->handler instanceof HandlerInterface) {
            $record = end($this->buffer) ?: null;

            $this->handler = call_user_func($this->handler, $record, $this);
            if (!$this->handler instanceof HandlerInterface) {
                throw new \RuntimeException("The factory callable should return a HandlerInterface");
            }
        }
        $this->handler->handleBatch($this->buffer);
        $this->buffer = [];
    }
1229550
def on(self, name, _callback=None):
        

        # this is being used as a decorator
        if _callback is None:
            return lambda cb: self.on(name, cb)

        if not (callable(_callback) or isawaitable(_callback)):
            msg = "Callback not callable: {0!r}".format(_callback)
            raise ValueError(msg)

        self._event_list[name].append(_callback)
        return _callback
1189350
public void submitCallable(Callable<Void> callable, String name) {
    this.futures.add(new NamedFuture(this.executor.submit(callable), name));
  }
933402
def add_listener(self, listener_type, callback):
        
        self.listener_type= listener_type
        if listener_type == 'objectHovered':
            self.listener_callback_source_hover= callback
        elif listener_type == 'objectClicked':
            self.listener_callback_source_click= callback
        elif listener_type == 'click':
            self.listener_callback_click= callback
        elif listener_type == 'select':
            self.listener_callback_select= callback

        self.listener_flag= not self.listener_flag
988497
public void registerCallback(UOWScopeCallback callback)
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "registerCallback", new Object[]{callback, this});
        
        _callbackManager.addCallback(callback);
        
        if (tc.isEntryEnabled()) Tr.exit(tc, "registerCallback");
    }
757615
@SideOnly(Side.CLIENT)
	public static void onRenderBlock(IRenderBlockCallback callback, CallbackOption<IRenderBlockCallbackPredicate> option)
	{
		renderBlockRegistry.registerCallback(callback, option);
	}
738524
def register(self, *paths, methods=None, name=None, handler=None):
        
        if isinstance(methods, str):
            methods = [methods]

        def wrapper(view):
            if handler is None:

                handler_ = view
                methods_ = methods or [METH_ANY]

                if isfunction(handler_) or ismethod(handler_):
                    handler_ = Handler.from_view(view, *methods_, name=name)

                handler_.bind(self, *paths, methods=methods_, name=name)

            else:

                view_name = view.__name__
                if not hasattr(handler, view_name):
                    setattr(handler, view_name, to_coroutine(view))
                name_ = name or view_name
                handler.bind(self, *paths, methods=methods, name=name_, view=view_name)

            return view

        # Support for @app.register(func)
        if len(paths) == 1 and callable(paths[0]):
            view = paths[0]

            if isclass(view) and issubclass(view, BaseException):
                return wrapper

            paths = []
            return wrapper(view)

        return wrapper
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
		);

	}
1336019
public void startup() throws Throwable
   {
      if (handlerClassName == null || handlerClassName.trim().equals(""))
         throw new IllegalStateException("HandlerClassName isn't defined");

      shutdown();

      ClassLoader cl = classLoader;

      if (cl == null)
         cl = EISServer.class.getClassLoader();

      Class handler = Class.forName(handlerClassName, true, cl);

      if (!Handler.class.isAssignableFrom(handler))
         throw new IllegalArgumentException("The specified handler class doesn't implement the interface");

      HandlerServer handlerServer = new HandlerServer(host, port, handler);
      handlerServer.start();

      handlerServers.put(getKey(), handlerServer);
   }
208667
public void registerEventCallback(ObjectManagerEventCallback callback)
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, "registerEventCallback", callback);

        objectManagerState.registerEventCallback(callback);

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, "registerEventCallback");
    }
1257415
def register_app(self, app):
        
        app.route(self.uri, methods=self.methods)(self.callable_obj)

        return self
1217898
def register_on_snapshot_taken(self, callback):
        
        event_type = library.VBoxEventType.on_snapshot_taken
        return self.event_source.register_callback(callback, event_type)
504565
public void registerCallback(String importer, ChannelChangeCallback callback) {
        Preconditions.checkArgument(
                importer != null && !importer.trim().isEmpty(),
                "importer is null or empty"
                );
        callback = checkNotNull(callback, "callback is null");

        if (m_done.get()) return;

        int [] stamp = new int[]{0};
        NavigableMap<String,ChannelChangeCallback> prev = null;
        NavigableMap<String,ChannelChangeCallback> next = null;
        ImmutableSortedMap.Builder<String,ChannelChangeCallback> mbldr = null;

        synchronized (m_undispatched) {
            do {
                prev = m_callbacks.get(stamp);
                mbldr = ImmutableSortedMap.naturalOrder();
                mbldr.putAll(Maps.filterKeys(prev, not(equalTo(importer))));
                mbldr.put(importer, callback);
                next = mbldr.build();
            } while (!m_callbacks.compareAndSet(prev, next, stamp[0], stamp[0]+1));

            NavigableSet<String> registered = next.navigableKeySet();
            NavigableSet<String> unregistered = m_unregistered.getReference();

            Iterator<ImporterChannelAssignment> itr = m_undispatched.iterator();
            while (itr.hasNext()) {
                final ImporterChannelAssignment assignment = itr.next();
                if (registered.contains(assignment.getImporter())) {
                    final ChannelChangeCallback dispatch = next.get(assignment.getImporter());
                    m_buses.submit(new DistributerRunnable() {
                        @Override
                        public void susceptibleRun() throws Exception {
                            dispatch.onChange(assignment);
                        }
                    });
                    itr.remove();
                } else if (unregistered.contains(assignment.getImporter())) {
                    itr.remove();
                    if (!assignment.getAdded().isEmpty()) {
                        LOG.warn("(" + m_hostId
                                + ") discarding assignment to unregistered importer "
                                + assignment);
                    }
                }
            }
        }
    }
758918
def bind(cls):
        
        super(cls, cls).bind()

        cls.search_btn_el.bind("click", cls.start)
        cls.input_el.bind("keypress", func_on_enter(cls.start))
735779
def register_callback(self, callback, remove=False):
        """"""

        # (Un)Register the callback.
        if remove and callback in self.callbacks:
            self.callbacks.remove(callback)
        elif not remove and callback not in self.callbacks:
            self.callbacks.append(callback)
894317
@Override
    public void registerCallback(UOWScopeCallback callback) {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "registerCallback", callback);

        UserTransactionImpl.instance().registerCallback(callback);

        if (tc.isEntryEnabled())
            Tr.exit(tc, "registerCallback");
    }