Emit a new event with given arguments.

 @param name [Symbol] The event name.
 @param args [optional, Array] The list of arguments to pass.
 @return [true, false] True if any callbacks were invoked, nil otherwise
772143
def emit name, *args
      # Trigger callbacks in scripts before triggering events in the client.
      EM.defer { notify_scripts name, *args }

      matching_callbacks = callbacks[name]
      return false unless matching_callbacks&.any?

      EM.defer do
        matching_callbacks.each { |callback| callback.call *args }
      end
    end
746701
function (name) {
			return function (args, onDone) {
				
				if (typeof args === 'function') {
					onDone = args;
					args = {};
				}
				
				console.log('calling API [' + name + ']...');
				
				// NOTE: by default callbacks are always kept
				SR.sendEvent(name, args, function (result) {
					if (result.err) {
						console.error(result.err);
						return SR.safeCall(onDone, result.err);
					}
					
					SR.safeCall(onDone, null, result.result);
				}, undefined, true);
			}
		}
217489
function(events, name, callback, options) {
    if (callback) {
      var handlers = events[name] || (events[name] = []);
      var context = options.context, ctx = options.ctx, listening = options.listening;
      if (listening) listening.count++;

      handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});
    }
    return events;
  }
730979
function(eventName, args) {

      // Run interactions
      var fieldValue = args[0];
      var fieldInstance = args[1];
      this.runInteractions(fieldInstance,fieldValue);
      
      //this.setClassFromState();
      
      this.fireUpdatedEvt();
   }
1164086
function (name, callback) {
        name = name.toLowerCase()
        this._events || (this._events = {})
        var events = this._events[name] || (this._events[name] = [])
        events.push({
            callback: callback
        })
        return this;
    }
1363487
def on(self, event_name, callback):
        """"""
        if not event_name:
            return False

        _LOGGER.debug("Adding callback for event name: %s", event_name)

        self._callbacks[event_name].append((callback))

        return True
1073980
public void postMessage (String name, Object... args)
    {
        postMessage(Transport.DEFAULT, name, args);
    }
1309440
function emit(name, args, thisArg, delay) {
        var list = eventHandlers[name];
        if ( list ) {
            thisArg || (thisArg = this);
            if ( args ) {
                args = args.slice(); // make a copy
                args.unshift(name);
            }
            else {
                args = [name];
            }
            _.each(list, function (hdl, idx) {
                // var _args = args.slice();
                delay > -1
                    ? setTimeout(function () {
                        hdl.apply(thisArg, args);
                      }, delay)
                    : hdl.apply(thisArg, args)
                ;
            });
        }
        return this;
    }
580422
function(name, callback, context) {
      if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
      this._events || (this._events = {});
      var events = this._events[name] || (this._events[name] = []);
      events.push({callback: callback, context: context, ctx: context || this});
      return this;
    }
648925
private static boolean hasParameter(
		final String args[],
		final String name) {
		for (int i = 0; i < args.length; i++) {
			if (args[i].equals(name)) {
				return true;
			} // end if
		} // end for

		return false;
	}
1211825
public function trigger($event_name, array $arguments = [])
    {
        // Read in our config/events file so that we have them all!
        if (! $this->have_read_from_file)
        {
            $this->readConfigFile();
        }

        foreach ($this->listeners($event_name) as $listener)
        {
            if (! is_callable($listener)) continue;

            $result = call_user_func_array($listener, $arguments);

            if ($result === false)
            {
                return false;
            }
        }

        return true;
    }
771150
def define_event(name, args = {})
      args = {:create_method => true}.merge(args)
      name = name.to_sym
      
      if args[:create_method]
        define_method name do
          return event(name)
        end
      end
      
      @unobservable_instance_events ||= Set.new
      if @unobservable_instance_events.include? name
        return false
      else
        @unobservable_instance_events.add name
        return true
      end
    end
309302
public function triggerSubEvent($name, $event, $args = [])
    {
        return $this->getDispatcher($name)->triggerEvent($event, $args);
    }
661899
public static function trigger(string $name, ?array $args = null)
  {
    if (!isset(self::$events[$name])) return false;

    foreach (self::$events[$name] as $event => $callback) {
      if (is_callable($callback)) {
        return call_user_func_array($callback, isset($args) ? $args : []);
      }
      else if (is_array($callback)) {
        (new Events)->triggerGroup($callback, $args);
      }
      else if (is_string($callback)) {
        $call = new $callback;
        return call_user_func_array([$call, 'persist'], $args ?? []);
      }
    }
  }
618068
function(name) {
		var args = arguments;
		args[0] = this.eventName(name);
		$.fn.on.apply(this.$el, args);
	}
541222
public void InvokeEvent(String eventName, JSONArray args)
    {
        HubOnDataCallback subscription;
        if(mSubscriptions.containsKey(eventName))
        {
        	subscription = mSubscriptions.get(eventName);
            subscription.OnReceived(args);
        }
    }
867568
def call(self, name: str, *args, **kwargs):
        ''''''
        if self._event_dispatcher is not None:
            self._event_dispatcher.notify(name, *args, **kwargs)

        if self._callbacks[name]:
            return self._callbacks[name](*args, **kwargs)
        else:
            raise HookDisconnected('No callback is connected.')