Creates a {@link ServerSentEvent} instance with an event type.

@param eventType Type for the event.
@param data Data for the event.

@return The {@link ServerSentEvent} instance.
341269
public static ServerSentEvent withEventType(ByteBuf eventType, ByteBuf data) {
        return new ServerSentEvent(null, eventType, data);
    }
1248505
public synchronized EventData getNextEvent(int event_type) throws DevFailed {
        EventData ev_data = null;
        for (EventData event : events)
            if (event.event_type == event_type)
                ev_data = event;
        if (ev_data == null)
            Except.throw_exception("BUFFER_EMPTY",
                    "No " + TangoConst.eventNames[event_type] + " in event queue.",
                    "EventQueue.getNextEvent()");
        events.remove(ev_data);
        return ev_data;
    }
785097
public String putEvents(List<EventType> eventTypes) throws PutEventsFault {
        if (LOG.isLoggable(Level.INFO)) {
            LOG.info("Received event(" + eventTypes.size() + ") from Agent.");
        }
        List<Event> events = new ArrayList<Event>(eventTypes.size());

        try {
            for (EventType eventType : eventTypes) {
                events.add(EventTypeMapper.map(eventType));
            }
        } catch (RuntimeException e) {
            throwFault("004", "Could not map web service data to event." + e.getMessage(), e);
        }

        try {
            monitoringService.putEvents(events);
        } catch (MonitoringException e) {
            e.logException(Level.SEVERE);
            throwFault(e.getCode(), e.getMessage(), e);
        } catch (Throwable t) {
            throwFault("000", "Unknown error " + t.getMessage(), t);
        }

        return "success";
    }
249784
public void addEventType(String eventType)
    {
        if(this.eventTypes == null)
            this.eventTypes = new ArrayList<String>();
        this.eventTypes.add(eventType);
    }
1153818
function Event(type, data, bubbles) {
            if (data === void 0) { data = null; }
            if (bubbles === void 0) { bubbles = false; }
            this._type = type;
            this._bubbles = bubbles;
            this.data = data;
        }
249968
@SuppressWarnings("unchecked")
  public <L, E> EventLog<L, E> getOrCreateEventLog(Class<?> type, String name, Function<EventLog<L, E>, L> listenerFactory) {
    return eventRegistries.computeIfAbsent(type, t -> new ConcurrentHashMap<>())
        .computeIfAbsent(name, n -> new EventLog<>(listenerFactory));
  }
274504
public function createEntityEvent($event, $entityType, $entityId, array $properties = [], DateTime $eventTime = null)
    {
        $event = new EntityEvent($event, $entityType, $entityId);
        $event->setProperties($properties);
        $event->setEventTime($eventTime);
        $response = $this->createEvent($event->toArray());

        return $response;
    }
352561
def new_event_type(self, name, mergeable=False):
    '''  '''

    self.event_types[name] = self.EventType(name, mergeable)
320710
function(type, callback) {
            this._events = this._events || {};

            if ( !(type in this._events) ) {
                this._events[type] = this.createEvent(type);
            }

            YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments);
        }
1142922
@Beta
    public Type getCustomEventMapping(final String eventType) {
        if (!containsCustomEventMappingFor(eventType)) {
            return null;
        } else {
            return this.eventTypeToEventDataMapping.get(canonicalizeEventType(eventType));
        }
    }
695928
@Beta
    public boolean removeCustomEventMapping(final String eventType) {
        if (!containsCustomEventMappingFor(eventType)) {
            return false;
        } else {
            this.eventTypeToEventDataMapping.remove(canonicalizeEventType(eventType));
            return true;
        }
    }
1046403
@Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
        for (Class<?> t = type.getRawType(); (t != Object.class) && (t.getSuperclass() != null); t = t.getSuperclass()) {
            for (Method m : t.getDeclaredMethods()) {
                if (m.isAnnotationPresent(PostConstruct.class)) {
                    m.setAccessible(true);
                    TypeAdapter<T> delegate = gson.getDelegateAdapter(this, type);
                    return new PostConstructAdapter<T>(delegate, m);
                }
            }
        }
        return null;
    }
258384
static String buildCombinedType(String eventType, Optional<String> objectType) {
    return Joiner.on("/").skipNulls().join(eventType, objectType.orNull());
  }
24444
@Beta
    public EventGridEvent[] deserializeEventGridEvents(final String requestContent, final SerializerAdapter<ObjectMapper> serializerAdapter) throws IOException {
        EventGridEvent[] eventGridEvents = serializerAdapter.<EventGridEvent[]>deserialize(requestContent, EventGridEvent[].class);
        for (EventGridEvent receivedEvent : eventGridEvents) {
            if (receivedEvent.data() == null) {
                continue;
            } else {
                final String eventType = receivedEvent.eventType();
                final Type eventDataType;
                if (SystemEventTypeMappings.containsMappingFor(eventType)) {
                    eventDataType = SystemEventTypeMappings.getMapping(eventType);
                } else if (containsCustomEventMappingFor(eventType)) {
                    eventDataType = getCustomEventMapping(eventType);
                } else {
                    eventDataType = null;
                }
                if (eventDataType != null) {
                    final String eventDataAsString = serializerAdapter.serializeRaw(receivedEvent.data());
                    final Object eventData = serializerAdapter.<Object>deserialize(eventDataAsString, eventDataType);
                    setEventData(receivedEvent, eventData);
                }
            }
        }
        return eventGridEvents;
    }
1169973
function OpenEventObserver(clientPort, serverPort) {
    events.EventEmitter.call(this);

    this.isClientPortOpen = false;
    this.isServerPortOpen = false;

    clientPort.on('open', this._clientPortOpenHandler(this));
    serverPort.on('open', this._serverPortOpenHandler(this));
}
281090
public static ContentData create(byte[] data, String type, @Nullable String name) {
        return new ContentData(RequestBody.create(MediaType.parse(type), data), name);
    }
1021830
public static void fireCmsEvent(int type, Map<String, Object> data) {

        OpenCmsCore.getInstance().getEventManager().fireEvent(type, data);
    }