Interface EventSink<E>
- All Known Implementing Classes:
RingBuffer
-
Method Summary
Modifier and TypeMethodDescriptionvoid
publishEvent
(EventTranslator<E> translator) Publishes an event to the ring buffer.<A> void
publishEvent
(EventTranslatorOneArg<E, A> translator, A arg0) Allows one user supplied argument.<A,
B, C> void publishEvent
(EventTranslatorThreeArg<E, A, B, C> translator, A arg0, B arg1, C arg2) Allows three user supplied arguments<A,
B> void publishEvent
(EventTranslatorTwoArg<E, A, B> translator, A arg0, B arg1) Allows two user supplied arguments.void
publishEvent
(EventTranslatorVararg<E> translator, Object... args) Allows a variable number of user supplied argumentsvoid
publishEvents
(EventTranslator<E>[] translators) Publishes multiple events to the ring buffer.void
publishEvents
(EventTranslator<E>[] translators, int batchStartsAt, int batchSize) Publishes multiple events to the ring buffer.<A> void
publishEvents
(EventTranslatorOneArg<E, A> translator, int batchStartsAt, int batchSize, A[] arg0) Allows one user supplied argument per event.<A> void
publishEvents
(EventTranslatorOneArg<E, A> translator, A[] arg0) Allows one user supplied argument per event.<A,
B, C> void publishEvents
(EventTranslatorThreeArg<E, A, B, C> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1, C[] arg2) Allows three user supplied arguments per event.<A,
B, C> void publishEvents
(EventTranslatorThreeArg<E, A, B, C> translator, A[] arg0, B[] arg1, C[] arg2) Allows three user supplied arguments per event.<A,
B> void publishEvents
(EventTranslatorTwoArg<E, A, B> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1) Allows two user supplied arguments per event.<A,
B> void publishEvents
(EventTranslatorTwoArg<E, A, B> translator, A[] arg0, B[] arg1) Allows two user supplied arguments per event.void
publishEvents
(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args) Allows a variable number of user supplied arguments per event.void
publishEvents
(EventTranslatorVararg<E> translator, Object[]... args) Allows a variable number of user supplied arguments per event.boolean
tryPublishEvent
(EventTranslator<E> translator) Attempts to publish an event to the ring buffer.<A> boolean
tryPublishEvent
(EventTranslatorOneArg<E, A> translator, A arg0) Allows one user supplied argument.<A,
B, C> boolean tryPublishEvent
(EventTranslatorThreeArg<E, A, B, C> translator, A arg0, B arg1, C arg2) Allows three user supplied arguments<A,
B> boolean tryPublishEvent
(EventTranslatorTwoArg<E, A, B> translator, A arg0, B arg1) Allows two user supplied arguments.boolean
tryPublishEvent
(EventTranslatorVararg<E> translator, Object... args) Allows a variable number of user supplied argumentsboolean
tryPublishEvents
(EventTranslator<E>[] translators) Attempts to publish multiple events to the ring buffer.boolean
tryPublishEvents
(EventTranslator<E>[] translators, int batchStartsAt, int batchSize) Attempts to publish multiple events to the ring buffer.<A> boolean
tryPublishEvents
(EventTranslatorOneArg<E, A> translator, int batchStartsAt, int batchSize, A[] arg0) Allows one user supplied argument.<A> boolean
tryPublishEvents
(EventTranslatorOneArg<E, A> translator, A[] arg0) Allows one user supplied argument.<A,
B, C> boolean tryPublishEvents
(EventTranslatorThreeArg<E, A, B, C> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1, C[] arg2) Allows three user supplied arguments per event.<A,
B, C> boolean tryPublishEvents
(EventTranslatorThreeArg<E, A, B, C> translator, A[] arg0, B[] arg1, C[] arg2) Allows three user supplied arguments per event.<A,
B> boolean tryPublishEvents
(EventTranslatorTwoArg<E, A, B> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1) Allows two user supplied arguments per event.<A,
B> boolean tryPublishEvents
(EventTranslatorTwoArg<E, A, B> translator, A[] arg0, B[] arg1) Allows two user supplied arguments per event.boolean
tryPublishEvents
(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args) Allows a variable number of user supplied arguments per event.boolean
tryPublishEvents
(EventTranslatorVararg<E> translator, Object[]... args) Allows a variable number of user supplied arguments per event.
-
Method Details
-
publishEvent
Publishes an event to the ring buffer. It handles claiming the next sequence, getting the current (uninitialised) event from the ring buffer and publishing the claimed sequence after translation.- Parameters:
translator
- The user specified translation for the event
-
tryPublishEvent
Attempts to publish an event to the ring buffer. It handles claiming the next sequence, getting the current (uninitialised) event from the ring buffer and publishing the claimed sequence after translation. Will return false if specified capacity was not available.- Parameters:
translator
- The user specified translation for the event- Returns:
- true if the value was published, false if there was insufficient capacity.
-
publishEvent
Allows one user supplied argument.- Type Parameters:
A
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventarg0
- A user supplied argument.- See Also:
-
tryPublishEvent
Allows one user supplied argument.- Type Parameters:
A
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventarg0
- A user supplied argument.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-
publishEvent
Allows two user supplied arguments.- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventarg0
- A user supplied argument.arg1
- A user supplied argument.- See Also:
-
tryPublishEvent
Allows two user supplied arguments.- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventarg0
- A user supplied argument.arg1
- A user supplied argument.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-
publishEvent
Allows three user supplied arguments- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argumentC
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventarg0
- A user supplied argument.arg1
- A user supplied argument.arg2
- A user supplied argument.- See Also:
-
tryPublishEvent
<A,B, boolean tryPublishEventC> (EventTranslatorThreeArg<E, A, B, C> translator, A arg0, B arg1, C arg2) Allows three user supplied arguments- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argumentC
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventarg0
- A user supplied argument.arg1
- A user supplied argument.arg2
- A user supplied argument.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-
publishEvent
Allows a variable number of user supplied arguments- Parameters:
translator
- The user specified translation for the eventargs
- User supplied arguments.- See Also:
-
tryPublishEvent
Allows a variable number of user supplied arguments- Parameters:
translator
- The user specified translation for the eventargs
- User supplied arguments.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-
publishEvents
Publishes multiple events to the ring buffer. It handles claiming the next sequence, getting the current (uninitialised) event from the ring buffer and publishing the claimed sequence after translation.
With this call the data that is to be inserted into the ring buffer will be a field (either explicitly or captured anonymously), therefore this call will require an instance of the translator for each value that is to be inserted into the ring buffer.
- Parameters:
translators
- The user specified translation for each event
-
publishEvents
Publishes multiple events to the ring buffer. It handles claiming the next sequence, getting the current (uninitialised) event from the ring buffer and publishing the claimed sequence after translation.
With this call the data that is to be inserted into the ring buffer will be a field (either explicitly or captured anonymously), therefore this call will require an instance of the translator for each value that is to be inserted into the ring buffer.
- Parameters:
translators
- The user specified translation for each eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batch
-
tryPublishEvents
Attempts to publish multiple events to the ring buffer. It handles claiming the next sequence, getting the current (uninitialised) event from the ring buffer and publishing the claimed sequence after translation. Will return false if specified capacity was not available.- Parameters:
translators
- The user specified translation for the event- Returns:
- true if the value was published, false if there was insufficient capacity.
-
tryPublishEvents
Attempts to publish multiple events to the ring buffer. It handles claiming the next sequence, getting the current (uninitialised) event from the ring buffer and publishing the claimed sequence after translation. Will return false if specified capacity was not available.- Parameters:
translators
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batch- Returns:
- true if all the values were published, false if there was insufficient capacity.
-
publishEvents
Allows one user supplied argument per event.- Type Parameters:
A
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventarg0
- A user supplied argument.- See Also:
-
publishEvents
<A> void publishEvents(EventTranslatorOneArg<E, A> translator, int batchStartsAt, int batchSize, A[] arg0) Allows one user supplied argument per event.- Type Parameters:
A
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for each eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batcharg0
- An array of user supplied arguments, one element per event.- See Also:
-
tryPublishEvents
Allows one user supplied argument.- Type Parameters:
A
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for each eventarg0
- An array of user supplied arguments, one element per event.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-
tryPublishEvents
<A> boolean tryPublishEvents(EventTranslatorOneArg<E, A> translator, int batchStartsAt, int batchSize, A[] arg0) Allows one user supplied argument.- Type Parameters:
A
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for each eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batcharg0
- An array of user supplied arguments, one element per event.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-
publishEvents
Allows two user supplied arguments per event.- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventarg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.- See Also:
-
publishEvents
<A,B> void publishEvents(EventTranslatorTwoArg<E, A, B> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1) Allows two user supplied arguments per event.- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batch.arg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.- See Also:
-
tryPublishEvents
Allows two user supplied arguments per event.- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventarg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-
tryPublishEvents
<A,B> boolean tryPublishEvents(EventTranslatorTwoArg<E, A, B> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1) Allows two user supplied arguments per event.- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batch.arg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-
publishEvents
<A,B, void publishEventsC> (EventTranslatorThreeArg<E, A, B, C> translator, A[] arg0, B[] arg1, C[] arg2) Allows three user supplied arguments per event.- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argumentC
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventarg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.arg2
- An array of user supplied arguments, one element per event.- See Also:
-
publishEvents
<A,B, void publishEventsC> (EventTranslatorThreeArg<E, A, B, C> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1, C[] arg2) Allows three user supplied arguments per event.- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argumentC
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The number of elements in the batch.arg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.arg2
- An array of user supplied arguments, one element per event.- See Also:
-
tryPublishEvents
<A,B, boolean tryPublishEventsC> (EventTranslatorThreeArg<E, A, B, C> translator, A[] arg0, B[] arg1, C[] arg2) Allows three user supplied arguments per event.- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argumentC
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventarg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.arg2
- An array of user supplied arguments, one element per event.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-
tryPublishEvents
<A,B, boolean tryPublishEventsC> (EventTranslatorThreeArg<E, A, B, C> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1, C[] arg2) Allows three user supplied arguments per event.- Type Parameters:
A
- Class of the user supplied argumentB
- Class of the user supplied argumentC
- Class of the user supplied argument- Parameters:
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batch.arg0
- An array of user supplied arguments, one element per event.arg1
- An array of user supplied arguments, one element per event.arg2
- An array of user supplied arguments, one element per event.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-
publishEvents
Allows a variable number of user supplied arguments per event.- Parameters:
translator
- The user specified translation for the eventargs
- User supplied arguments, one Object[] per event.- See Also:
-
publishEvents
void publishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args) Allows a variable number of user supplied arguments per event.- Parameters:
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batchargs
- User supplied arguments, one Object[] per event.- See Also:
-
tryPublishEvents
Allows a variable number of user supplied arguments per event.- Parameters:
translator
- The user specified translation for the eventargs
- User supplied arguments, one Object[] per event.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-
tryPublishEvents
boolean tryPublishEvents(EventTranslatorVararg<E> translator, int batchStartsAt, int batchSize, Object[]... args) Allows a variable number of user supplied arguments per event.- Parameters:
translator
- The user specified translation for the eventbatchStartsAt
- The first element of the array which is within the batch.batchSize
- The actual size of the batch.args
- User supplied arguments, one Object[] per event.- Returns:
- true if the value was published, false if there was insufficient capacity.
- See Also:
-