Packages

t

csw.event.api.scaladsl

EventSubscriber

trait EventSubscriber extends AnyRef

An EventSubscriber interface to subscribe events. The events can be subscribed on csw.params.events.EventKey. All events published on this key will be received by subscribers.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EventSubscriber
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def get(eventKey: EventKey): Future[Event]

    Get latest event for the given Event Key.

    Get latest event for the given Event Key. If an event is not published for any eventKey, then invalid event is returned for that Event Key.

    In case the underlying server is not available, the future fails with csw.event.api.exceptions.EventServerNotAvailable exception. In all other cases of exception, the future fails with the respective exception

    eventKey

    an csw.params.events.EventKey to subscribe to

    returns

    a future which completes with the latest csw.params.events.Event for the provided Event Key

  2. abstract def get(eventKeys: Set[EventKey]): Future[Set[Event]]

    Get latest events for multiple Event Keys.

    Get latest events for multiple Event Keys. The latest events available for the given Event Keys will be received first. If event is not published for one or more event keys, invalid event will be received for those Event Keys.

    In case the underlying server is not available, the future fails with csw.event.api.exceptions.EventServerNotAvailable exception. In all other cases of exception, the future fails with the respective exception

    eventKeys

    a set of csw.params.events.EventKey to subscribe to

    returns

    a future which completes with a set of latest csw.params.events.Event for the provided Event Keys

  3. abstract def pSubscribe(subsystem: Subsystem, pattern: String): Source[Event, EventSubscription]

    Subscribe to events from Event Keys specified using a subsystem and a pattern to match the remaining Event Key.

    Subscribe to events from Event Keys specified using a subsystem and a pattern to match the remaining Event Key. The latest events available for the given Event Keys will be received first. If event is not published for one or more event keys, invalid event will be received for those Event Keys.

    At the time of invocation, in case the underlying server is not available, csw.event.api.exceptions.EventServerNotAvailable exception is thrown and the subscription is stopped after logging appropriately. csw.event.api.scaladsl.EventSubscription!.ready method can be used to determine this state. In all other cases of exception, the subscription resumes to receive remaining elements.

    subsystem

    a valid Subsystem which represents the source of the events

    pattern

    Subscribes the client to the given patterns. Supported glob-style patterns:

    • h?llo subscribes to hello, hallo and hxllo
    • h*llo subscribes to hllo and heeeello
    • h[ae]llo subscribes to hello and hallo, but not hillo Use \ to escape special characters if you want to match them verbatim.
    returns

    a akka.stream.scaladsl.Source of csw.params.events.Event. The materialized value of the source provides an csw.event.api.scaladsl.EventSubscription which can be used to unsubscribe from all the Event Keys which were subscribed to

  4. abstract def pSubscribeCallback(subsystem: Subsystem, pattern: String, callback: (Event) => Unit): EventSubscription

    Subscribes a callback to events from Event Keys specified using a subsystem and a pattern to match the remaining Event Key.

    Subscribes a callback to events from Event Keys specified using a subsystem and a pattern to match the remaining Event Key.

    The latest events available for the given Event Keys will be received first. If event is not published for one or more event keys, invalid event will be received for those Event Keys.

    At the time of invocation, in case the underlying server is not available, csw.event.api.exceptions.EventServerNotAvailable exception is thrown and the subscription is stopped after logging appropriately. csw.event.api.scaladsl.EventSubscription!.ready method can be used to determine this state. In all other cases of exception, the subscription resumes to receive remaining elements.

    subsystem

    a valid Subsystem which represents the source of the events

    pattern

    Subscribes the client to the given patterns. Supported glob-style patterns: - h?llo subscribes to hello, hallo and hxllo - h*llo subscribes to hllo and heeeello - h[ae]llo subscribes to hello and hallo, but not hillo Use \ to escape special characters if you want to match them verbatim.

    callback

    a function to execute on each received event

    returns

    an csw.event.api.scaladsl.EventSubscription which can be used to unsubscribe from all the Event Keys which were subscribed to

    Note

    Callbacks are not thread-safe on the JVM. If you are doing side effects/mutations inside the callback, you should ensure that it is done in a thread-safe way inside an actor.

  5. abstract def subscribe(eventKeys: Set[EventKey], every: FiniteDuration, mode: SubscriptionMode): Source[Event, EventSubscription]

    Subscribe to multiple eventKeys and receive events at every frequency according to the specified mode (RateAdapter or RateLimiter).

    Subscribe to multiple eventKeys and receive events at every frequency according to the specified mode (RateAdapter or RateLimiter). The latest events available for the given Event Keys will be received first. If event is not published for one or more event keys, invalid event will be received for those Event Keys.

    At the time of invocation, in case the underlying server is not available, csw.event.api.exceptions.EventServerNotAvailable exception is thrown and the stream is stopped after logging appropriately. In all other cases of exception, as per the default behavior, the stream will stop. To avoid that, user should provide a resuming materializer while running the stream.

    eventKeys

    a set of csw.params.events.EventKey to subscribe to

    every

    the duration which determines the frequency with which events are received

    mode

    an appropriate csw.event.api.scaladsl.SubscriptionMode to control the behavior of rate of events w.r.t. the given frequency. Refer the API documentation for SubscriptionMode for more details

    returns

    a akka.stream.scaladsl.Source of csw.params.events.Event. The materialized value of the source provides an csw.event.api.scaladsl.EventSubscription which can be used to unsubscribe from all the Event Keys which were subscribed to

    Note

    All the other APIs of csw.event.api.scaladsl.EventSubscriber that do not return a akka.stream.scaladsl.Source, internally use the resuming materializer which will ignore the failed event and resume receiving further events.

  6. abstract def subscribe(eventKeys: Set[EventKey]): Source[Event, EventSubscription]

    Subscribe to multiple Event Keys and get a single stream of events for all event keys.

    Subscribe to multiple Event Keys and get a single stream of events for all event keys. The latest events available for the given Event Keys will be received first. If event is not published for one or more event keys, invalid event will be received for those Event Keys.

    At the time of invocation, in case the underlying server is not available csw.event.api.exceptions.EventServerNotAvailable exception is thrown and the stream is stopped after logging appropriately. In all other cases of exception, as per the default behavior, the stream will stop. To avoid that, user should provide a resuming materializer while running the stream.

    eventKeys

    a set of csw.params.events.EventKey to subscribe to

    returns

    a akka.stream.scaladsl.Source of csw.params.events.Event. The materialized value of the source provides an csw.event.api.scaladsl.EventSubscription which can be used to unsubscribe from all the Event Keys which were subscribed to

    Note

    All the other APIs of csw.event.api.scaladsl.EventSubscriber that do not return a akka.stream.scaladsl.Source, internally use the resuming materializer which will ignore the failed event and resume receiving further events.

  7. abstract def subscribeActorRef(eventKeys: Set[EventKey], actorRef: ActorRef[Event], every: FiniteDuration, mode: SubscriptionMode): EventSubscription

    Overload for above subscribeActorRef for receiving event at a every frequency according to the specified mode.

    Overload for above subscribeActorRef for receiving event at a every frequency according to the specified mode. The latest events available for the given Event Keys will be received first. If event is not published for one or more event keys, invalid event will be received for those Event Keys.

    At the time of invocation, in case the underlying server is not available, csw.event.api.exceptions.EventServerNotAvailable exception is thrown and the subscription is stopped after logging appropriately. csw.event.api.scaladsl.EventSubscription!.ready method can be used to determine this state. In all other cases of exception, the subscription resumes to receive remaining elements.

    eventKeys

    a set of csw.params.events.EventKey to subscribe to

    actorRef

    an actorRef of an actor to which each received event is redirected

    every

    the duration which determines the frequency with which events are received

    mode

    an appropriate csw.event.api.scaladsl.SubscriptionMode to control the behavior of rate of events w.r.t. the given frequency. Refer the API documentation for SubscriptionMode for more details

    returns

    an csw.event.api.scaladsl.EventSubscription which can be used to unsubscribe from all the Event Keys which were subscribed to

  8. abstract def subscribeActorRef(eventKeys: Set[EventKey], actorRef: ActorRef[Event]): EventSubscription

    Subscribes an actor to events from multiple event keys.

    Subscribes an actor to events from multiple event keys. The latest events available for the given Event Keys will be received first. If event is not published for one or more event keys, invalid event will be received for those Event Keys.

    At the time of invocation, in case the underlying server is not available, csw.event.api.exceptions.EventServerNotAvailable exception is thrown and the subscription is stopped after logging appropriately. csw.event.api.scaladsl.EventSubscription!.ready method can be used to determine this state. In all other cases of exception, the subscription resumes to receive remaining elements.

    eventKeys

    a set of csw.params.events.EventKey to subscribe to

    actorRef

    an actorRef of an actor which handles each received event

    returns

    an csw.event.api.scaladsl.EventSubscription which can be used to unsubscribe from all the Event Keys which were subscribed to

  9. abstract def subscribeAsync(eventKeys: Set[EventKey], callback: (Event) => Future[_], every: FiniteDuration, mode: SubscriptionMode): EventSubscription

    Overload for above subscribeAsync for receiving event at a every frequency according to the specified mode.

    Overload for above subscribeAsync for receiving event at a every frequency according to the specified mode. The latest events available for the given Event Keys will be received first. If event is not published for one or more event keys, invalid event will be received for those Event Keys.

    At the time of invocation, in case the underlying server is not available, csw.event.api.exceptions.EventServerNotAvailable exception is thrown and the subscription is stopped after logging appropriately. csw.event.api.scaladsl.EventSubscription!.ready method can be used to determine this state. In all other cases of exception, the subscription resumes to receive remaining elements.

    eventKeys

    a set of csw.params.events.EventKey to subscribe to

    callback

    a function to execute on each received event

    every

    the duration which determines the frequency with which events are received

    mode

    an appropriate csw.event.api.scaladsl.SubscriptionMode to control the behavior of rate of events w.r.t. the given frequency. Refer the API documentation for SubscriptionMode for more details

    returns

    an csw.event.api.scaladsl.EventSubscription which can be used to unsubscribe from all the Event Keys which were subscribed to

  10. abstract def subscribeAsync(eventKeys: Set[EventKey], callback: (Event) => Future[_]): EventSubscription

    Subscribes an asynchronous callback function to events from multiple eventKeys.

    Subscribes an asynchronous callback function to events from multiple eventKeys. The callback is of type event => future and it ensures that the event callbacks are called sequentially in such a way that the subsequent execution will start only after the prior one completes. This API gives the guarantee of ordered execution of the asynchronous callbacks.

    The latest events available for the given Event Keys will be received first. If event is not published for one or more event keys, invalid event will be received for those Event Keys.

    At the time of invocation, in case the underlying server is not available, csw.event.api.exceptions.EventServerNotAvailable exception is thrown and the subscription is stopped after logging appropriately. csw.event.api.scaladsl.EventSubscription!.ready method can be used to determine this state. In all other cases of exception, the subscription resumes to receive remaining elements.

    eventKeys

    a set of csw.params.events.EventKey to subscribe to

    callback

    a function to execute asynchronously on each received event

    returns

    an csw.event.api.scaladsl.EventSubscription which can be used to unsubscribe from all the Event Keys which were subscribed to

    Note

    Callbacks are not thread-safe on the JVM. If you need to do side effects/mutations, prefer using subscribeActorRef API.

  11. abstract def subscribeCallback(eventKeys: Set[EventKey], callback: (Event) => Unit, every: FiniteDuration, mode: SubscriptionMode): EventSubscription

    Overload for above subscribeCallback for receiving event at a every frequency according to the specified mode.

    Overload for above subscribeCallback for receiving event at a every frequency according to the specified mode. The latest events available for the given Event Keys will be received first. If event is not published for one or more event keys, invalid event will be received for those Event Keys.

    At the time of invocation, in case the underlying server is not available, csw.event.api.exceptions.EventServerNotAvailable exception is thrown and the subscription is stopped after logging appropriately. csw.event.api.scaladsl.EventSubscription!.ready method can be used to determine this state. In all other cases of exception, the subscription resumes to receive remaining elements.

    eventKeys

    a set of csw.params.events.EventKey to subscribe to

    callback

    a function to execute on each received event

    every

    the duration which determines the frequency with which events are received

    mode

    an appropriate csw.event.api.scaladsl.SubscriptionMode to control the behavior of rate of events w.r.t. the given frequency. Refer the API documentation for SubscriptionMode for more details

    returns

    an csw.event.api.scaladsl.EventSubscription which can be used to unsubscribe from all the Event Keys which were subscribed to

  12. abstract def subscribeCallback(eventKeys: Set[EventKey], callback: (Event) => Unit): EventSubscription

    Subscribes a callback function to events from multiple event keys.

    Subscribes a callback function to events from multiple event keys. The latest events available for the given Event Keys will be received first. If event is not published for one or more event keys, invalid event will be received for those Event Keys.

    At the time of invocation, in case the underlying server is not available, csw.event.api.exceptions.EventServerNotAvailable exception is thrown and the subscription is stopped after logging appropriately. csw.event.api.scaladsl.EventSubscription!.ready method can be used to determine this state. In all other cases of exception, the subscription resumes to receive remaining elements.

    eventKeys

    a set of csw.params.events.EventKey to subscribe to

    callback

    a function to execute on each received event

    returns

    an csw.event.api.scaladsl.EventSubscription which can be used to unsubscribe from all the Event Keys which were subscribed to

    Note

    Callbacks are not thread-safe on the JVM. If you need to do side effects/mutations, prefer using subscribeActorRef API. Also note that any exception thrown from callback is expected to be handled by the component developers.

  13. abstract def subscribeObserveEvents(): Source[Event, EventSubscription]

    ************ IMPORTANT ************ This API uses redis pattern subscription.

    ************ IMPORTANT ************ This API uses redis pattern subscription. Having many live pattern subscriptions causes overall latency degradation. Prefer subscribe API over this whenever possible. *********** ********* ************

    Subscribe to all the observe events

    At the time of invocation, in case the underlying server is not available, csw.event.api.exceptions.EventServerNotAvailable exception is thrown and the subscription is stopped after logging appropriately. csw.event.api.scaladsl.EventSubscription!.ready method can be used to determine this state. In all other cases of exception, the subscription resumes to receive remaining elements.

    returns

    a akka.stream.scaladsl.Source of csw.params.events.Event. The materialized value of the source provides an csw.event.api.scaladsl.EventSubscription which can be used to unsubscribe from observe events subscription

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped