Package jetbrains.buildServer.serverSide
Interface MultiNodesEvents
-
- All Known Implementing Classes:
MultiNodesEventsDbImpl
public interface MultiNodesEvents
Allows to publish simple low-level events to other TeamCity nodes in multi-nodes setup. It's important that every event can have only one subscriber. If you need to react on event in several places then you should implement one 'main' listener which will handle the event and propagate it to all the interested parts. Also subscribers should assume that the event can be sometimes outdated, i.e. 'buildStarted' event may happen when the node is already aware of the build.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
MultiNodesEvents.Event
static class
MultiNodesEvents.EventData
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
ensureEventsProcessed()
Loads and processes all fresh eventsvoid
ensureEventsProcessed(Filter<MultiNodesEvents.EventData> eventsFilter)
Ensure that all events which have been published by other nodes and match the filter are processed.boolean
eventsPublishingEnabled()
boolean
hasUnpublishedEvent(MultiNodesEvents.EventData eventData)
boolean
hasUnpublishedEvents(Filter<MultiNodesEvents.EventData> eventsFilter)
void
publish(String eventName)
void
publish(String eventName, Long longArg)
void
publish(String eventName, String strArg)
void
publish(MultiNodesEvents.EventData eventData)
void
subscribe(String eventName, Consumer<MultiNodesEvents.Event> eventConsumer)
Adds an "events consumer" which will process events with the given name.void
subscribeOnEvents(String eventName, Consumer<List<MultiNodesEvents.Event>> eventConsumer)
Adds an "events consumer" which will process a pack of consequitive events with the same name at once.void
unsubscribe(String eventName)
unregister consumer for specified event name
-
-
-
Method Detail
-
publish
void publish(@NotNull String eventName)
-
publish
void publish(@NotNull MultiNodesEvents.EventData eventData)
-
subscribe
void subscribe(@NotNull String eventName, @NotNull Consumer<MultiNodesEvents.Event> eventConsumer) throws IllegalArgumentException
Adds an "events consumer" which will process events with the given name. There can be only one consumer per each event name.- Parameters:
eventName
-eventConsumer
-- Throws:
IllegalArgumentException
- if another consumer for this event name is already registered
-
subscribeOnEvents
void subscribeOnEvents(@NotNull String eventName, @NotNull Consumer<List<MultiNodesEvents.Event>> eventConsumer) throws IllegalArgumentException
Adds an "events consumer" which will process a pack of consequitive events with the same name at once. There can be only one consumer per each event name.- Parameters:
eventName
-eventConsumer
-- Throws:
IllegalArgumentException
- if another consumer for this event name is already registered- Since:
- 2021.2
-
unsubscribe
void unsubscribe(@NotNull String eventName)
unregister consumer for specified event name- Since:
- 2020.2.4
-
ensureEventsProcessed
void ensureEventsProcessed()
Loads and processes all fresh events
-
hasUnpublishedEvent
boolean hasUnpublishedEvent(@NotNull MultiNodesEvents.EventData eventData)
- Parameters:
eventData
-- Returns:
- true if event is still not published and other nodes can't see it
-
hasUnpublishedEvents
boolean hasUnpublishedEvents(@NotNull Filter<MultiNodesEvents.EventData> eventsFilter)
- Returns:
- true if at least one event that match specified filter is still not published and other nodes can't see it
-
ensureEventsProcessed
void ensureEventsProcessed(@NotNull Filter<MultiNodesEvents.EventData> eventsFilter)
Ensure that all events which have been published by other nodes and match the filter are processed.
-
eventsPublishingEnabled
boolean eventsPublishingEnabled()
-
-