Register event loop.
772635
protected function registerEventLoop()
    {
        $this->app->singleton(LoopInterface::class, function () {
            return new StreamSelectLoop();
        });
        $this->app->alias(LoopInterface::class, 'ami.eventloop');
    }
489078
public static function register()
    {
        $namespace = "Vinala\App\Events";

        foreach (get_declared_classes() as $value) {
            if (Strings::contains($value, $namespace)) {
                $name = self::getName($value);

                $events = $value::getEvents();

                if (!is_null($events)) {
                    foreach ($events as $key => $value) {
                        $data[$name.'.'.$key] = $value;
                    }
                }

                self::$listners = array_collapse([$data, self::$listners]);
            }
        }
    }
179986
public void register(EventDefinition eventDefinition, IEventListener listener) {
        if (eventDefinition.getType() == EventDefinition.TYPE_POST) {
            register(listenersPost, eventDefinition, listener, true);
        } else {
            register(listeners, eventDefinition, listener, false);
        }
    }
567852
protected function registerClientEvents() {
		if (!empty($this->clientEvents)) {
			$id = $this->options['id'];
			$js = [];
			foreach ($this->clientEvents as $event => $handler) {
				$js[] = "jQuery('#$id').on('$event', $handler);";
			}
			$this->view->registerJs(implode("\n", $js));
		}
	}
403877
protected function registerListeners()
    {
        Event::listen(RouteMatched::class, BlockLoad::class);
        Event::listen(GzeroRouteMatched::class, BlockLoad::class);
        Event::listen('block.*', BlockCacheClear::class);
    }
798524
def register(self, event, keys):
        
        if self.running:
            raise RuntimeError("Can't register while running")
        handler = self._handlers.get(event, None)
        if handler is not None:
            raise ValueError("Event {} already registered".format(event))
        self._handlers[event] = EventHandler(event, keys, loop=self.loop)
300451
def event_trigger(self, event_type):
        """"""
        def callback(**kwargs):
            self.queued_events.append(event_type(**kwargs))
        return callback
1372444
function register(handle) {
  if (Array.isArray(handle)) {
    handle.forEach(item => {
      utils.register(item);
    });
  } else {
    utils.register(handle);
  }
}
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)
366045
def bind_events(self, events):
        '''
        '''
        evs = self._events
        if evs and events:
            for event in evs.values():
                if event.name in events:
                    event.bind(events[event.name])
90891
function _loop(i) {
				var eventName = eventNames[i];
				var actionGroup = instructions[eventName];

				ws.addEventListener(eventName, function (res) {

					processActionGroup({ res: res, actionGroup: actionGroup });

					// TODO handle sending messages
				});
			}
616669
def set_event_loop(self, event_loop):
        """"""
        assert event_loop is None or isinstance(event_loop, AbstractEventLoop)
        self._event_loop = event_loop
550038
protected void registerEventListener() {

        OpenCms.addCmsEventListener(
            this,
            new int[] {
                I_CmsEventListener.EVENT_RESOURCE_AND_PROPERTIES_MODIFIED,
                I_CmsEventListener.EVENT_RESOURCES_AND_PROPERTIES_MODIFIED,
                I_CmsEventListener.EVENT_RESOURCE_MODIFIED,
                I_CmsEventListener.EVENT_RESOURCES_MODIFIED,
                I_CmsEventListener.EVENT_RESOURCE_MOVED,
                I_CmsEventListener.EVENT_RESOURCE_DELETED,
                I_CmsEventListener.EVENT_PUBLISH_PROJECT,
                I_CmsEventListener.EVENT_CLEAR_CACHES,
                I_CmsEventListener.EVENT_CLEAR_ONLINE_CACHES,
                I_CmsEventListener.EVENT_CLEAR_OFFLINE_CACHES});
    }
743576
public function registerEvents()
    {
        // Delete user tokens after login
        if (config('passwordless.empty_tokens_after_login') === true) {
            Event::listen(
                Authenticated::class,
                function (Authenticated $event) {
                    $event->user->tokens()
                        ->delete();
                }
            );
        }
    }
620921
protected static function events()
    {
        foreach (self::fetch('app/events', false) as $file) {
            Bus::need($file);
        }
        //
        Event::register();
    }
422446
def register_event(self, *names):
        
        for name in names:
            if name in self.__events:
                continue
            self.__events[name] = Event(name)
418706
def register(self, name: str):
        ''''''
        if name in self._callbacks:
            raise ValueError('Hook already registered')

        self._callbacks[name] = None

        if self._event_dispatcher is not None:
            self._event_dispatcher.register(name)