Sets the given callback to the existing open or install request in the queue

@param callback A{@link Branch.BranchReferralInitListener} callback instance.
778138
void setInstallOrOpenCallback(Branch.BranchReferralInitListener callback) {
        synchronized (reqQueueLockObject) {
            for (ServerRequest req : queue) {
                if (req != null) {
                    if (req instanceof ServerRequestRegisterInstall) {
                        ((ServerRequestRegisterInstall) req).setInitFinishedCallback(callback);
                    } else if (req instanceof ServerRequestRegisterOpen) {
                        ((ServerRequestRegisterOpen) req).setInitFinishedCallback(callback);
                    }
                }
            }
        }
    }
396532
public void registerCallback(UOWCallback callback)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "registerCallback", callback);

        if (!_callbacks.contains(callback))
        {
            _callbacks.add(callback);

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Number of registered Callbacks: "+_callbacks.size());
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "registerCallback");
    }
673211
def set_error_callback(self, callback):
        
        self.logger.debug('Setting error callback: %r', callback)
        self._on_error = callback
458915
public synchronized void sendRetry(long retry, EventCallback callback) {

        if (open == 0 || shutdown) {
            if (callback != null) {
                callback.failed(this, null, null, null, new ClosedChannelException());
            }
            return;
        }
        queue.add(new SSEData(retry, callback));
        sink.getIoThread().execute(new Runnable() {
            @Override
            public void run() {
                synchronized (ServerSentEventConnection.this) {
                    if (pooled == null) {
                        fillBuffer();
                        writeListener.handleEvent(sink);
                    }
                }
            }
        });
    }
703917
public final void setDateDetailsCallback(Callback<DateDetailsParameter, Boolean> callback) {
        requireNonNull(callback);
        dateDetailsCallbackProperty().set(callback);
    }
53200
@Override
	public final void setCaptureCallback(CaptureCallback callback) {
		if (callback == null)
			throw new NullPointerException("The callback object cannot be null");

		synchronized (state){
			// make sure we are in the right state.
			if (state.isStarted())
				throw new StateException("This frame grabber is already started");

			// create the push source object
			pushSource = new PushSource(this, callback, threadFactory);
		}
	}
1184438
public function setCallback($callback)
    {
        if($callback instanceof Closure)
        {
            $this->callback = $callback;
        }
        elseif(is_callable($callback))
        {
            $this->callback = function($chunk) use($callback)
            {
                return call_user_func_array($callback, [$chunk]);
            };
        }
        else
        {
            throw new Exception('Invalid callback');
        }

        return $this;
    }
174988
public void setInitialRequestNumber(int initialRequestNumber)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setInitialRequestNumber", Integer.valueOf(initialRequestNumber));
        this.requestNumber = initialRequestNumber;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setInitialRequestNumber");
    }
114474
public function setApiCallback($callback)
    {

        if (empty($callback)) {
            $this->apiResponseCallback = false;
            return;
        }

        if (!is_callable($callback)) {
            throw new \Exception('Callback should be a function or false.');
        }

        $this->apiResponseCallback = $callback;
    }
1086607
public void registerCallback(C callback, CallbackOption<P> option)
	{
		callbacks.add(Pair.of(callback, option));
		callbacks = Ordering.natural()
							.reverse()
							.onResultOf(Priority::ordinal)
							.onResultOf(CallbackOption<P>::getPriority)
							.onResultOf(Pair<C, CallbackOption<P>>::getRight)
							.sortedCopy(callbacks);
	}
244944
function (callback) {
            var promise = new Promise();
            this.addCallback(function () {
                try {
                    when(isFunction(callback) ? callback.apply(this, arguments) : callback).then(promise);
                } catch (e) {
                    promise.errback(e);
                }
            });

            this.addErrback(function () {
                try {
                    when(isFunction(callback) ? callback.apply(this, arguments) : callback).then(promise);
                } catch (e) {
                    promise.errback(e);
                }
            });
            return promise.promise();
        }
212588
public void registerView(@Nullable RegisterViewStatusListener callback) {
        if (Branch.getInstance() != null) {
            Branch.getInstance().registerView(this, callback);
        } else {
            if (callback != null) {
                callback.onRegisterViewFinished(false, new BranchError("Register view error", BranchError.ERR_BRANCH_NOT_INSTANTIATED));
            }
        }
    }
233674
public function setCallback($callback = null)
    {
        if (null !== $callback) {
            // partially taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/
            // partially taken from https://github.com/willdurand/JsonpCallbackValidator
            //      JsonpCallbackValidator is released under the MIT License. See https://github.com/willdurand/JsonpCallbackValidator/blob/v1.1.0/LICENSE for details.
            //      (c) William Durand <william.durand1@gmail.com>
            $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*(?:\[(?:"(?:\\\.|[^"\\\])*"|\'(?:\\\.|[^\'\\\])*\'|\d+)\])*?$/u';
            $reserved = [
                'break', 'do', 'instanceof', 'typeof', 'case', 'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue', 'for', 'switch', 'while',
                'debugger', 'function', 'this', 'with', 'default', 'if', 'throw', 'delete', 'in', 'try', 'class', 'enum', 'extends', 'super',  'const', 'export',
                'import', 'implements', 'let', 'private', 'public', 'yield', 'interface', 'package', 'protected', 'static', 'null', 'true', 'false',
            ];
            $parts = explode('.', $callback);
            foreach ($parts as $part) {
                if (!preg_match($pattern, $part) || \in_array($part, $reserved, true)) {
                    throw new \InvalidArgumentException('The callback name is not valid.');
                }
            }
        }

        $this->callback = $callback;

        return $this->update();
    }
160804
public static <P extends ICallbackPredicate> CallbackOption<P> of(Priority priority)
		{
			return new CallbackOption<>(null, priority);
		}
1235806
public void open(Functions.Func callback) {
        open();
        Scheduler.get().scheduleFixedDelay(() -> {
            callback.call();
            return false;
        }, inDuration);
    }
244870
public static void apply(String selector, Functions.Func callback) {
        apply($(selector).asElement(), 100, callback);
    }
8638
public function setCallback(callable $callback, array $params = [])
    {
        if ($this->hasCallback()) {
            throw new ArchException('Callback already defined');
        }
        $this->callback = $callback;
        $this->callbackParams = $params;
        return $this;
    }