Dispatch handling of this event to a receiver.

        This method will invoke ``receiver._document_patched`` if it exists.
426450
def dispatch(self, receiver):
        ''' 

        '''
        super(DocumentPatchedEvent, self).dispatch(receiver)
        if hasattr(receiver, '_document_patched'):
            receiver._document_patched(self)
4856
def apply(self, event, document, *args, **kwargs):
        
        for fn in self._handler_dict.get(event, []):
            fn(document, *args, **kwargs)
1080294
def process_op(self, ns, raw):
        
        # Compute the document id of the document that will be altered
        # (in case of insert, update or delete).
        docid = self.__get_id(raw)

        op = raw['op']
        if op == 'i':
            self.insert(ns=ns, docid=docid, raw=raw)
        elif op == 'u':
            self.update(ns=ns, docid=docid, raw=raw)
        elif op == 'd':
            self.delete(ns=ns, docid=docid, raw=raw)
        elif op == 'c':
            self.command(ns=ns, raw=raw)
        elif op == 'db':
            self.db_declare(ns=ns, raw=raw)
        elif op == 'n':
            self.noop()
        else:
            logging.error("Unknown op: %r" % op)

        # Save timestamp of last processed oplog.
        self.ts = raw['ts']
1369746
@UpdateHandler(name = "update_record", file = "RegisteredServiceDocument_update.js")
    public void updateRecord(final RegisteredServiceDocument record) {
        if (record.getId() == null) {
            add(record);
        } else {
            db.callUpdateHandler(stdDesignDocumentId, "update_record", record.getId(), CollectionUtils.wrap("doc", record));
        }
    }
674005
def attach_event_handler(canvas, handler=close_on_esc_or_middlemouse):
    
    if getattr(canvas, "_py_event_dispatcher_attached", None):
        return

    event_dispatcher = C.TPyDispatcherProcessedEvent(handler)
    canvas.Connect("ProcessedEvent(int,int,int,TObject*)",
                   "TPyDispatcherProcessedEvent", event_dispatcher,
                   "Dispatch(int,int,int,TObject*)")

    # Attach a handler only once to each canvas, and keep the dispatcher alive
    canvas._py_event_dispatcher_attached = event_dispatcher
808543
function patchUncaught() {
  var name = 'uncaughtException';
  var originalListener = process.listeners(name).pop();

  if (originalListener) {
    process.removeListener(name, originalListener);
  }

  return function() {
    if (!originalListener) return;
    process.on(name, originalListener);
  };
}
329305
async def handler(event):
    """"""
    await event.delete()

    await event.respond(
        get_docs_message(kind=event.pattern_match.group(1),
                         query=event.pattern_match.group(2)),
        reply_to=event.reply_to_msg_id
    )
1153911
def patched(f):
    """"""

    def wrapped(*args, **kwargs):

        kwargs['return_response'] = False
        kwargs['prefetch'] = True

        return f(*args, **kwargs)

    return wrapped
1010897
function dispatchEvent(event) {
    var type = event.type;
    var listeners = this._eventListeners[type] || [];

    for (var i = 0; i < listeners.length; i++) {
      if (typeof listeners[i] == "function") {
        listeners[i].call(this, event);
      } else {
        listeners[i].handleEvent(event);
      }
    }

    return !!event.defaultPrevented;
  }
154104
def send_document(self, *args, **kwargs):
        """"""
        return send_document(*args, **self._merge_overrides(**kwargs)).run()
374798
function(event) {
            var state = self.state();

            for ( var i in self._callbacks ) {
                self._callbacks[i].call(self._doc, event, state);
            }
        }
798558
function onDocumentState (doc, stateFn, callback) {
  let ready = stateFn(doc)

  if (ready) {
    callback(doc)

    return
  }

  const readyListener = () => {
    if (!stateFn(doc)) {
      return
    }

    if (!ready) {
      ready = true
      callback(doc)
    }

    doc.removeEventListener('readystatechange', readyListener)
  }

  doc.addEventListener('readystatechange', readyListener)
}
1089401
protected <E> void dispatchEvent(E event, Collection<Throwable> errors) {

    @SuppressWarnings({ "unchecked", "rawtypes" })
    Class<E> eventType = (Class) event.getClass();
    EventDispatcher<? super E> eventDispatcher = getEventDispatcherOptional(eventType);
    boolean dispatched = false;
    if (eventDispatcher != null) {
      dispatched = eventDispatcher.handleEvent(event, errors);
    }
    if (!dispatched) {
      handleUndispatchedEvent(event);
    }
  }
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); }
    }
875798
def update_handler(feeds):
		''''''
		# Check if this call is a result of actions initiated from
		#  one of the hooks in a higher frame (resulting in recursion).
		if Feed._filters_update_handler_lock: return
		return Feed._filters_update_handler(Feed, feeds, force=True)
759311
function _handleRelatedDocumentDeleted(url) {
        var liveDoc = _relatedDocuments[url];
        if (liveDoc) {
            delete _relatedDocuments[url];
        }

        if (_server) {
            _server.remove(liveDoc);
        }
        _closeDocument(liveDoc);
    }
1151073
def handler(event, context):  # pylint: disable=W0613
    
    records = deserialize_records(event['Records'])

    # Split records into two groups, update and delete.
    # We don't want to query for deleted records.
    update_records, delete_records = group_records_by_type(records, UPDATE_EVENTS)

    LOG.debug('[@] Processing update records...')
    process_update_records(update_records)
    LOG.debug('[@] Completed processing of update records.')

    LOG.debug('[@] Processing delete records...')
    process_delete_records(delete_records)
    LOG.debug('[@] Completed processing of delete records.')

    LOG.debug('[@] Successfully updated current Historical table')