Register the given callback as to be executed after request completion.

@param name The name of the bean.
@param callback The callback of the bean to be executed for destruction.
355982
public void registerDestructionCallback(String name, Runnable callback) {
		Bean bean = beans.get(name);
		if (null == bean) {
			bean = new Bean();
			beans.put(name, bean);
		}
		bean.destructionCallback = callback;
	}
724837
public function registerHelper(string $name, callable $callback): self
    {
        $this->helpers->add($name, $callback);
        return $this;
    }
435067
public function registerCallback($event, $callback)
    {
        $this->checkEventType($event);
        $this->events[$event][] = $callback;
    }
1193464
public function viaRequest( $name, callable $callback )
	{
		$this->guards[$name] = new RequestGuard( $callback, Request::i() );
	}
131211
protected function registerEvent($name, Closure $callback)
    {
        if (! isset(static::$dispatcher)) {
            $this->initEventDispatcher();
        }

        static::$dispatcher->listen($name, $callback);
    }
16978
public String registerMBean(Object bean, String name)
            throws MalformedObjectNameException, NotCompliantMBeanException, MBeanRegistrationException {
        return registerMBean(bean, name, false);
    }
1347063
@Override
    public void registerDestructionCallback(String name, Runnable callback) {
        final HttpSession session = this.getPortalSesion(true);
        final DestructionCallbackBindingListener callbackListener =
                new DestructionCallbackBindingListener(callback);
        session.setAttribute(DESTRUCTION_CALLBACK_NAME_PREFIX + name, callbackListener);
    }
415629
public function add(string $name, callable $callback): \IvoPetkov\BearFrameworkAddons\ServerRequests
    {
        $this->callbacks[$name] = $callback;
        return $this;
    }
69468
@SuppressWarnings({ "rawtypes", "unchecked" })
	private static void execute(final String application, final String name,
			final WidgetConfigurationCallback callback) {
		ClientApplicationInfo applicationInfo = CONFIG.get(application);

		// First search the application level widget configurations:
		ClientWidgetInfo widgetInfo = applicationInfo.getWidgetInfo(name);
		if (widgetInfo != null) {
			callback.execute(widgetInfo);
			return;
		}

		// Next, search within each map configuration:
		for (ClientMapInfo mapInfo : applicationInfo.getMaps()) {
			widgetInfo = search(mapInfo, name);
			if (widgetInfo != null) {
				callback.execute(widgetInfo);
				return;
			}
		}

		callback.execute(null); // found nothing, still invoke the callback!
	}
951010
private void processCallback(final Callback callback) {
        try {
            JsonNode result = handleCallback(callback);
            this.getClient().completeCallback(callback, null, result);
        } catch (JsiiException e) {
            this.getClient().completeCallback(callback, e.getMessage(), null);
        }
    }
1277357
public function register(string $name, callable $callback): ResolverInterface
    {
        //if it's not callable
        if (!is_callable($callback)) {
            throw ResolverException::forInvalidCallback();
        }

        $this->registry[$name] = $callback;
        return $this;
    }
63335
public static function register( $name, $callback = null, $sanitizer = null ) {
		unset( static::$resolved[ $name ] );

		if ( $callback instanceof Field_Type ) {
			$instance = $callback;

			list( $callback, $sanitizer ) = [
				[ $instance, 'display' ],
				[ $instance, 'sanitization' ],
			];

			static::$instances[ $name ] = $instance;
		}

		static::$bindings[ $name ] = compact( 'callback', 'sanitizer' );
	}
617198
public function register($name, $callback)
    {
        if (! isset($this->registered_menus[$name])) {
            $this->registered_menus[$name] = [];
        }

        $this->registered_menus[$name][] = $callback;

        return $this;
    }
627809
protected function addEventListener($name, $callback, $priority = null)
    {
        if (is_null($priority)) {
            $this->events->listen($name, $callback);
        } else {
            $this->events->listen($name, $callback, $priority);
        }
    }
827636
function (name, method) {
        // TODO: deal with registerPriority in 3.0
        this.map.events.registerPriority(name, this, method);
        this.map.events.registerPriority(name, this, this.setEvent);
    }
971081
private function checkCallbackName(&$name)
    {
        if ( ! is_string($name)) {
            $type = gettype($name);

            throw new Exceptions\InvalidTypeException(
                "The callback name value must be a string, $type given."
            );
        }

        $name = strtolower(trim($name));
    }
108454
def on(self, name, callback, once=False):
        
        if name not in self.event_listeners:
            self.event_listeners[name] = []

        self.event_listeners[name].append((callback, once))