Callback invoked by a database observer.
<p>
NOTE: Two parameters, observer and context, which are defined for iOS:
observer -> this instance
context ->  maintained in java layer
323430
private static void callback(long handle, String docID, long sequence) {
        final C4DocumentObserver obs = REVERSE_LOOKUP_TABLE.get(handle);
        if (obs != null && obs.listener != null) { obs.listener.callback(obs, docID, sequence, obs.context); }
    }
15697
def on_change(self, callable_):
        
        self.model.add_observer(
            callable_, self.entity_type, 'change', self.entity_id)
240297
public void onStartWithServer(ExecutionContext<I> context, ExecutionInfo info) {
        for (ExecutionListener<I, O> listener: listeners) {
            try {
                if (!isListenerDisabled(listener)) {
                    listener.onStartWithServer(context.getChildContext(listener), info);
                }
            } catch (Throwable e) {
                if (e instanceof AbortExecutionException) {
                    throw (AbortExecutionException) e;
                }
                logger.error("Error invoking listener " + listener, e);
            }
        }
    }
187430
@Override
    public void registerAdapterDataObserver(RecyclerView.AdapterDataObserver observer) {
        super.registerAdapterDataObserver(observer);
        if (mAdapter != null) {
            mAdapter.registerAdapterDataObserver(observer);
        }
    }
1168910
public void callback(final Callback callback)
    {
        Runnable runnable = new Runnable()
        {
            @Override
            public void run()
            {
                try
                {
                    callback.result(queryId, awaitResult());
                }
                catch (Exception e)
                {
                    callback.error(queryId, e);
                }
            }
        };
        EXECUTOR_SERVICE.submit(runnable);
    }
92103
function (when, methodName, record) {
            var callbacks = registry[when][methodName]
            for (var i = 0, l = callbacks.length; i < l; i++) {
                callbacks[i].call(this, record)
            }
        }
999483
public static <T> Observer<? super T> log() {
        return new Observer<T>() {

            @Override
            public void onCompleted() {
                // do nothing
            }

            @Override
            public void onError(Throwable e) {
                log.error(e.getMessage(), e);
            }

            @Override
            public void onNext(T t) {
                log.info(t + "");
            }
        };
    }
880967
function callHandler(callback, context, args) {
  switch (args.length) {
    case 0: return callback.call(context);
    case 1: return callback.call(context, args[0]);
    case 2: return callback.call(context, args[0], args[1]);
    case 3: return callback.call(context, args[0], args[1], args[2]);
    default: return callback.apply(context, args);
  }
}
803870
public void addMithraNotificationEventForUpdate(String databaseIdentifier, String classname, byte databaseOperation,
                                                    MithraDataObject mithraDataObject, List updateWrappers,
                                                    Object sourceAttribute)
    {
        MithraDataObject[] dataObjects = new MithraDataObject[1];
        dataObjects[0] = mithraDataObject;
        createAndAddNotificationEvent(databaseIdentifier, classname, databaseOperation, dataObjects, updateWrappers, null, sourceAttribute);
    }
156579
function(selector, context) {
  this.selector = selector;
  if (typeof context == 'function') {
    this.context = null;
    this.asyncExecute(null, null, context);
  }
  else {
    this.context = context;
  }

  this.instance = -1;
  this.index = -1;
  this.length = -1;
}
750462
def register_observer(self, observer, events=None):
        
        if events is not None and not isinstance(events, (tuple, list)):
            events = (events,)

        if observer in self._observers:
            LOG.warning("Observer '%r' already registered, overwriting for events"
                        " %r", observer, events)
        self._observers[observer] = events
826185
public <T> void register(Class<T> event, EventObserver<T> observer){
        if(event == null){
            throw new IllegalArgumentException("Null Event type passed to register");
        }
        if(observer == null){
            throw new IllegalArgumentException("Null observer passed to register");
        }
        nullSafeGet(event).add(observer);
    }
457322
private <Y> void checkObserverMethod(EnhancedAnnotatedMethod<T, Y> annotated) {
        // Make sure exactly one and only one parameter is annotated with Observes or ObservesAsync
        List<EnhancedAnnotatedParameter<?, Y>> eventObjects = annotated.getEnhancedParameters(Observes.class);
        eventObjects.addAll(annotated.getEnhancedParameters(ObservesAsync.class));
        if (this.reception.equals(Reception.IF_EXISTS) && declaringBean.getScope().equals(Dependent.class)) {
            throw EventLogger.LOG.invalidScopedConditionalObserver(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
        }
        if (eventObjects.size() > 1) {
            throw EventLogger.LOG.multipleEventParameters(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
        }
        EnhancedAnnotatedParameter<?, Y> eventParameter = eventObjects.iterator().next();
        checkRequiredTypeAnnotations(eventParameter);
        // Check for parameters annotated with @Disposes
        List<?> disposeParams = annotated.getEnhancedParameters(Disposes.class);
        if (disposeParams.size() > 0) {
            throw EventLogger.LOG.invalidDisposesParameter(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
        }
        // Check annotations on the method to make sure this is not a producer
        // method, initializer method, or destructor method.
        if (this.observerMethod.getAnnotated().isAnnotationPresent(Produces.class)) {
            throw EventLogger.LOG.invalidProducer(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
        }
        if (this.observerMethod.getAnnotated().isAnnotationPresent(Inject.class)) {
            throw EventLogger.LOG.invalidInitializer(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
        }
        boolean containerLifecycleObserverMethod = Observers.isContainerLifecycleObserverMethod(this);
        for (EnhancedAnnotatedParameter<?, ?> parameter : annotated.getEnhancedParameters()) {
            // if this is an observer method for container lifecycle event, it must not inject anything besides BeanManager
            if (containerLifecycleObserverMethod && !parameter.isAnnotationPresent(Observes.class) && !parameter.isAnnotationPresent(ObservesAsync.class) && !BeanManager.class.equals(parameter.getBaseType())) {
                throw EventLogger.LOG.invalidInjectionPoint(this, Formats.formatAsStackTraceElement(annotated.getJavaMember()));
            }
        }

    }
621708
public void callManager(final Event event, final Callback callback) {
        if (delegate instanceof DefaultCommunicationClientImpl) {
            DefaultCommunicationClientImpl defaultClient = (DefaultCommunicationClientImpl) delegate;
            defaultClient.submit(new Runnable() {

                @Override
                public void run() {
                    Object result = callManager(event);
                    callback.call(result);
                }
            });
        }
    }
204049
function(Collection, Query, callback) {
			if (typeof callback !== 'function') { throw Error('The callback function is a required parameter for Count.'); }
			do_database_call(Socket, DatabaseType, {
					collection: Collection,
					operation: 'Count',
					query: Query
				},
				callback);
			return;
		}
1321417
protected void addObserver (Object obs)
    {
        if (_observers == null) {
            _observers = ObserverList.newFastUnsafe();
        }
        _observers.add(obs);
    }
231197
private ListenerToken addDatabaseChangeListener(Executor executor, DatabaseChangeListener listener) {
        // NOTE: caller method is synchronized.
        if (dbChangeNotifier == null) {
            dbChangeNotifier = new ChangeNotifier<>();
            registerC4DBObserver();
        }
        return dbChangeNotifier.addChangeListener(executor, listener);
    }