Domain tunable events handler
329294
def _domain_event_tunable_cb(conn, domain, params, opaque):
    '''
    
    '''
    _salt_send_domain_event(opaque, conn, domain, opaque['event'], {
        'params': params
    })
734194
function triggerHandler(eventName, event, target) {
              var match = !bubbleSelector;
              var el = bubbleSelector ? target : registeredOn;
              if (bubbleSelector) {
                var selectorFilter = getFilterFunc(bubbleSelector, registeredOn);
                while (el && el != registeredOn && !(match = selectorFilter(el)))
                  el = el['parentNode'];
              }
              return (!match) || (name != eventName) || ((handler.apply($(el), args || [event, index]) && prefix=='?') || prefix == '|');
            }
263779
def _domain_event_metadata_change_cb(conn, domain, mtype, nsuri, opaque):
    '''
    
    '''
    _salt_send_domain_event(opaque, conn, domain, opaque['event'], {
        'type': _get_libvirt_enum_string('VIR_DOMAIN_METADATA_', mtype),
        'nsuri': nsuri
    })
1067390
function handleAdminEvents() {

        //listen for clicks that bubble in up in the admin bar
        document.body.addEventListener('click', function (ev) {

            if(ev.target.hasAttribute('data-edit-include')) {
                launchPluginEditor(ev.target);
            } else if(ev.target.hasAttribute('data-add-include')) {
                launchAddInclude(ev.target);
            }
        });

        //intercept link clicks so the parent frame changes
        window.pagespace.interceptLinks = function(ev) {
            if(ev.target.tagName.toUpperCase() === 'A' && ev.target.getAttribute('href').indexOf('/') === 0) {
                var href = ev.target.getAttribute('href');
                window.parent.location.assign('/_dashboard#/view-page/preview' + href);
                ev.preventDefault();
            }
        };
        document.body.addEventListener('click', window.pagespace.interceptLinks);
    }
698904
final protected function apply(DomainEvent $event) : void
    {
        $this->handleEventInAggregate($event);
        parent::raise($event);
    }
1135199
def trigger(event_name, *data, &block)
      trigger!(event_name, *data, &block)
    rescue InvalidStateError, TransitionError, CallbackError
      false
    end
1225583
function handler (eventDetails){
  var Alert = models.getModels().Alert;
  logger.logger.trace(loggerPrefix +'Processing Alerts for Event: ', eventDetails);

  Alert.queryAlerts(eventDetails.uid, eventDetails.env, eventDetails.domain, function(err, alerts){
    if(err) {
      logger.logger.warn({ error:err }, loggerPrefix +'Failed to query Alerts for uid and env', uid, env);
    } else {
      if(alerts && alerts.length > 0){
        logger.logger.trace(loggerPrefix +'Found ['+ alerts.length +'] Alerts. Matching and send emails', alerts);
        matchAndIssueAlertEmails(eventDetails, alerts);
      } else {
        logger.logger.trace(loggerPrefix +'No Alerts for event. No emails to send.');
      }
    }
  });
}
1155677
function(event, data) {
        // we also want to trigger dom events
        if (this.options.domEvents) {
            triggerDomEvent(event, data);
        }

        // no handlers, so skip it all
        var handlers = this.handlers[event] && this.handlers[event].slice();
        if (!handlers || !handlers.length) {
            return;
        }

        data.type = event;
        data.preventDefault = function() {
            data.srcEvent.preventDefault();
        };

        var i = 0;
        while (i < handlers.length) {
            handlers[i](data);
            i++;
        }
    }
856273
static void capturePageEvent(String eventName, final EventHandler handler) {
    HtmlPlatform.captureEvent(eventName, new EventHandler() {
      @Override
      public void handleEvent(NativeEvent evt) {
        handler.handleEvent(evt);
      }
    });
  }
1237267
def _domain_event_agent_lifecycle_cb(conn, domain, state, reason, opaque):
    '''
    
    '''
    _salt_send_domain_event(opaque, conn, domain, opaque['event'], {
        'state': _get_libvirt_enum_string('VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_', state),
        'reason': _get_libvirt_enum_string('VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_', reason)
    })
585085
function switcher(events, rule){
    if (!rule)
    {
      rule = events;
      events = null;
    }

    if (typeof events == 'string')
      events = events.split(/\s+/);

    return new TemplateSwitchConfig({
      rule: rule,
      events: events
    });
  }
689316
def _register_handler(event, fun, external=False):
    """"""
    registry = core.HANDLER_REGISTRY
    if external:
        registry = core.EXTERNAL_HANDLER_REGISTRY

    if not isinstance(event, basestring):
        # If not basestring, it is a BaseEvent subclass.
        # This occurs when class methods are registered as handlers
        event = core.parse_event_to_name(event)

    if event in registry:
        registry[event].append(fun)
    else:
        registry[event] = [fun]
    return fun
454108
def handler(event, context):
    
    for record in event['Records']:
        process_dynamodb_differ_record(record, Durable{{cookiecutter.technology_slug | titlecase}}Model)
727370
function (eventName,handler) {
			var event;
			if (event = this.getEvent(eventName))
			{
				if (!event.once(handler,true))
					this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			} else
				this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			return this;
		}
1260591
function changeHandler(eventOptions = {}) {
    const { key, silent } = eventOptions;
    const def = defs.get(this);

    if (key && key in def.keys && !silent) {
        triggerOne(this, 'set', eventOptions);
        triggerOne(this, 'modify', eventOptions);
    }
}
479146
def _trigger(self, event_name, *args, **kwargs):
        
        self.log('event: %s' % event_name, *args)
        for f in self._events[event_name]:
            f(*args, **kwargs)
991839
public function dispatch(DomainEvents $events) : void {
        $events->each(function (DomainEvent $event) {
            $this->listeners->each(function (Listener $listener) use ($event) {
                    $listener->handle($event);
            });
        });
    }