Interface EventSink<E>

All Known Implementing Classes:
RingBuffer

public interface EventSink<E>
  • Method Details

    • publishEvent

      void publishEvent(EventTranslator<E> translator)
      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

      boolean tryPublishEvent(EventTranslator<E> translator)
      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

      <A> void publishEvent(EventTranslatorOneArg<E,A> translator, A arg0)
      Allows one user supplied argument.
      Type Parameters:
      A - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      arg0 - A user supplied argument.
      See Also:
    • tryPublishEvent

      <A> boolean tryPublishEvent(EventTranslatorOneArg<E,A> translator, A arg0)
      Allows one user supplied argument.
      Type Parameters:
      A - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      arg0 - A user supplied argument.
      Returns:
      true if the value was published, false if there was insufficient capacity.
      See Also:
    • publishEvent

      <A, B> void publishEvent(EventTranslatorTwoArg<E,A,B> translator, A arg0, B arg1)
      Allows two user supplied arguments.
      Type Parameters:
      A - Class of the user supplied argument
      B - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      arg0 - A user supplied argument.
      arg1 - A user supplied argument.
      See Also:
    • tryPublishEvent

      <A, B> boolean tryPublishEvent(EventTranslatorTwoArg<E,A,B> translator, A arg0, B arg1)
      Allows two user supplied arguments.
      Type Parameters:
      A - Class of the user supplied argument
      B - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      arg0 - 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

      <A, B, C> void publishEvent(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 argument
      B - Class of the user supplied argument
      C - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      arg0 - A user supplied argument.
      arg1 - A user supplied argument.
      arg2 - A user supplied argument.
      See Also:
    • tryPublishEvent

      <A, B, C> boolean tryPublishEvent(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 argument
      B - Class of the user supplied argument
      C - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      arg0 - 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

      void publishEvent(EventTranslatorVararg<E> translator, Object... args)
      Allows a variable number of user supplied arguments
      Parameters:
      translator - The user specified translation for the event
      args - User supplied arguments.
      See Also:
    • tryPublishEvent

      boolean tryPublishEvent(EventTranslatorVararg<E> translator, Object... args)
      Allows a variable number of user supplied arguments
      Parameters:
      translator - The user specified translation for the event
      args - User supplied arguments.
      Returns:
      true if the value was published, false if there was insufficient capacity.
      See Also:
    • publishEvents

      void publishEvents(EventTranslator<E>[] translators)

      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

      void publishEvents(EventTranslator<E>[] translators, int batchStartsAt, int batchSize)

      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
      batchStartsAt - The first element of the array which is within the batch.
      batchSize - The actual size of the batch
    • tryPublishEvents

      boolean tryPublishEvents(EventTranslator<E>[] translators)
      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

      boolean tryPublishEvents(EventTranslator<E>[] translators, int batchStartsAt, int batchSize)
      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
      batchStartsAt - 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

      <A> void publishEvents(EventTranslatorOneArg<E,A> translator, 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 the event
      arg0 - 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 event
      batchStartsAt - 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.
      See Also:
    • tryPublishEvents

      <A> boolean tryPublishEvents(EventTranslatorOneArg<E,A> translator, A[] arg0)
      Allows one user supplied argument.
      Type Parameters:
      A - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for each event
      arg0 - 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 event
      batchStartsAt - 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.
      Returns:
      true if the value was published, false if there was insufficient capacity.
      See Also:
    • publishEvents

      <A, B> void publishEvents(EventTranslatorTwoArg<E,A,B> translator, A[] arg0, B[] arg1)
      Allows two user supplied arguments per event.
      Type Parameters:
      A - Class of the user supplied argument
      B - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      arg0 - 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 argument
      B - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      batchStartsAt - 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

      <A, B> boolean tryPublishEvents(EventTranslatorTwoArg<E,A,B> translator, A[] arg0, B[] arg1)
      Allows two user supplied arguments per event.
      Type Parameters:
      A - Class of the user supplied argument
      B - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      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:
    • 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 argument
      B - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      batchStartsAt - 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, C> void publishEvents(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 argument
      B - Class of the user supplied argument
      C - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      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:
    • publishEvents

      <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.
      Type Parameters:
      A - Class of the user supplied argument
      B - Class of the user supplied argument
      C - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      batchStartsAt - 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, C> boolean tryPublishEvents(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 argument
      B - Class of the user supplied argument
      C - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      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:
    • tryPublishEvents

      <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.
      Type Parameters:
      A - Class of the user supplied argument
      B - Class of the user supplied argument
      C - Class of the user supplied argument
      Parameters:
      translator - The user specified translation for the event
      batchStartsAt - 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

      void publishEvents(EventTranslatorVararg<E> translator, Object[]... args)
      Allows a variable number of user supplied arguments per event.
      Parameters:
      translator - The user specified translation for the event
      args - 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 event
      batchStartsAt - 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.
      See Also:
    • tryPublishEvents

      boolean tryPublishEvents(EventTranslatorVararg<E> translator, Object[]... args)
      Allows a variable number of user supplied arguments per event.
      Parameters:
      translator - The user specified translation for the event
      args - 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 event
      batchStartsAt - 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: