trait EventPublisher extends AnyRef
An EventPublisher interface to publish events. The published events are published on a key determined by csw.params.events.EventKey in the csw.params.events.Event model. This key can be used by the subscribers using csw.event.api.scaladsl.EventSubscriber interface to subscribe to the events.
- Alphabetic
- By Inheritance
- EventPublisher
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def publish(eventGenerator: => Option[Event], startTime: TMTTime, every: FiniteDuration, onError: (PublishFailure) => Unit): Cancellable
Publish csw.params.events.Event from an
eventGenerator
function, which will be started at the specifiedstartTime
and will be executed atevery
frequency.Publish csw.params.events.Event from an
eventGenerator
function, which will be started at the specifiedstartTime
and will be executed atevery
frequency. Also, executeonError
callback for events whose publishing failed.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, the stream receives a csw.event.api.exceptions.PublishFailure exception which wraps the underlying exception and also provides the handle to the event which was failed to be published. The provided callback is executed on the failed element and the generator resumes to publish remaining elements.
- eventGenerator
a function which can generate an event to be published at
every
frequency- startTime
the time at which the
eventGenerator
should start generating events- every
frequency with which the events are to be published
- onError
a callback to execute for each event for which publishing failed
- returns
a handle to cancel the event generation through
eventGenerator
- Note
Callbacks like
eventGenerator
andonError
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. Also note that any exception thrown fromonError
callback is expected to be handled by component developers.
- abstract def publish(eventGenerator: => Option[Event], every: FiniteDuration, onError: (PublishFailure) => Unit): Cancellable
Publish csw.params.events.Event from an
eventGenerator
function, which will be executed atevery
frequency And executeonError
callback for events whose publishing failed.Publish csw.params.events.Event from an
eventGenerator
function, which will be executed atevery
frequency And executeonError
callback for events whose publishing failed.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, the stream receives a csw.event.api.exceptions.PublishFailure exception which wraps the underlying exception and also provides the handle to the event which was failed to be published. The provided callback is executed on the failed element and the generator resumes to publish remaining elements.
- eventGenerator
a function which can generate an event to be published at
every
frequency- every
frequency with which the events are to be published
- onError
a callback to execute for each event for which publishing failed
- returns
a handle to cancel the event generation through
eventGenerator
- Note
Callbacks like
eventGenerator
andonError
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. Also note that any exception thrown fromonError
callback is expected to be handled by component developers.
- abstract def publish(eventGenerator: => Option[Event], startTime: TMTTime, every: FiniteDuration): Cancellable
Publish csw.params.events.Event from an
eventGenerator
function, which will be started at the specifiedstartTime
and will be executed atevery
frequency.Publish csw.params.events.Event from an
eventGenerator
function, which will be started at the specifiedstartTime
and will be executed atevery
frequency.Cancellable
can be used to cancel the execution ofeventGenerator
function.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, the stream receives a csw.event.api.exceptions.PublishFailure exception which wraps the underlying exception. The generator resumes to publish remaining elements in case of this exception.
- eventGenerator
a function which can generate an event to be published at
every
frequency- startTime
the time at which the
eventGenerator
should start generating events- every
frequency with which the events are to be published
- returns
a handle to cancel the event generation through
eventGenerator
- Note
Callbacks like
eventGenerator
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.
- abstract def publish(eventGenerator: => Option[Event], every: FiniteDuration): Cancellable
Publish csw.params.events.Event from an
eventGenerator
function, which will be executed atevery
frequency.Publish csw.params.events.Event from an
eventGenerator
function, which will be executed atevery
frequency.Cancellable
can be used to cancel the execution ofeventGenerator
function.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, the stream receives a csw.event.api.exceptions.PublishFailure exception which wraps the underlying exception. The generator resumes to publish remaining elements in case of this exception.
- eventGenerator
a function which can generate an event to be published at
every
frequency- every
frequency with which the events are to be published
- returns
a handle to cancel the event generation through
eventGenerator
- Note
Callbacks like
eventGenerator
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.
- abstract def publish[Mat](source: Source[Event, Mat], onError: (PublishFailure) => Unit): Mat
Publish from a stream of csw.params.events.Event, and execute
onError
callback for events whose publishing failed.Publish from a stream of csw.params.events.Event, and execute
onError
callback for events whose publishing failed.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, the stream receives a csw.event.api.exceptions.PublishFailure exception which wraps the underlying exception and also provides the handle to the event which was failed to be published. The provided callback is executed on the failed element and the stream resumes to publish remaining elements.
- Mat
represents the type of materialized value as defined in the source to be obtained on running the stream
- source
a akka.stream.scaladsl.Source of events to be published. Any resource cleanup or exception handling of the provided source is to be managed by the source provider
- onError
a callback to execute for each event for which publishing failed
- returns
the materialized value obtained on running the stream
- Note
Callbacks like
onError
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.
- abstract def publish[Mat](source: Source[Event, Mat]): Mat
Publish from a stream of csw.params.events.Event
Publish from a stream of csw.params.events.Event
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, the stream receives a csw.event.api.exceptions.PublishFailure exception which wraps the underlying exception. The stream resumes to publish remaining elements in case of this exception.
- Mat
represents the type of materialized value as defined in the source to be obtained on running the stream
- source
a akka.stream.scaladsl.Source of events to be published. Any resource cleanup or exception handling of the provided source is to be managed by the source provider
- returns
the materialized value obtained on running the stream
- abstract def publish(event: Event): Future[Done]
Publish a single csw.params.events.Event
Publish a single csw.params.events.Event
At the time of invocation, in case the underlying server is not available, csw.event.api.exceptions.EventServerNotAvailable exception is thrown, in all other cases csw.event.api.exceptions.PublishFailure exception is thrown which wraps the underlying exception and also provides the handle to the event which was failed to be published
- event
an event to be published
- returns
a future which completes when the event is published
- abstract def publishAsync(eventGenerator: => Future[Option[Event]], startTime: TMTTime, every: FiniteDuration, onError: (PublishFailure) => Unit): Cancellable
Publish csw.params.events.Event from an asynchronous
eventGenerator
function, which will be started at the specifiedstartTime
and will be executed atevery
frequency.Publish csw.params.events.Event from an asynchronous
eventGenerator
function, which will be started at the specifiedstartTime
and will be executed atevery
frequency. Also, executeonError
callback for events whose publishing failed. This API is useful if your eventGenerator function generates an event asynchronously and returns a Future[Event].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, the stream receives a csw.event.api.exceptions.PublishFailure exception which wraps the underlying exception and also provides the handle to the event which was failed to be published. The provided callback is executed on the failed element and the generator resumes to publish remaining elements.
- eventGenerator
a function which can generate a Future of event to be published at
every
frequency- startTime
the time at which the
eventGenerator
should start generating events- every
frequency with which the events are to be published
- onError
a callback to execute for each event for which publishing failed
- returns
a handle to cancel the event generation through
eventGenerator
- Note
Callbacks like
eventGenerator
andonError
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. Also note that any exception thrown fromonError
callback is expected to be handled by component developers.
- abstract def publishAsync(eventGenerator: => Future[Option[Event]], every: FiniteDuration, onError: (PublishFailure) => Unit): Cancellable
Publish csw.params.events.Event from an asynchronous
eventGenerator
function, which will be executed atevery
frequency And executeonError
callback for events whose publishing failed.Publish csw.params.events.Event from an asynchronous
eventGenerator
function, which will be executed atevery
frequency And executeonError
callback for events whose publishing failed. This API is useful if your eventGenerator function generates an event asynchronously and returns a Future[Event].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, the stream receives a csw.event.api.exceptions.PublishFailure exception which wraps the underlying exception and also provides the handle to the event which was failed to be published. The provided callback is executed on the failed element and the generator resumes to publish remaining elements.
- eventGenerator
a function which can generate a Future of event to be published at
every
frequency- every
frequency with which the events are to be published
- onError
a callback to execute for each event for which publishing failed
- returns
a handle to cancel the event generation through
eventGenerator
- Note
Callbacks like
eventGenerator
andonError
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. Also note that any exception thrown fromonError
callback is expected to be handled by component developers.
- abstract def publishAsync(eventGenerator: => Future[Option[Event]], startTime: TMTTime, every: FiniteDuration): Cancellable
Publish csw.params.events.Event from an asynchronous
eventGenerator
function, which will be started at the specifiedstartTime
and will be executed atevery
frequency.Publish csw.params.events.Event from an asynchronous
eventGenerator
function, which will be started at the specifiedstartTime
and will be executed atevery
frequency. This API is useful if your eventGenerator function generates an event asynchronously and returns a Future[Event].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, the stream receives a csw.event.api.exceptions.PublishFailure exception which wraps the underlying exception and also provides the handle to the event which was failed to be published.
- eventGenerator
a function which can generate a Future of event to be published at
every
frequency- startTime
the time at which the
eventGenerator
should start generating events- every
frequency with which the events are to be published
- returns
a handle to cancel the event generation through
eventGenerator
- Note
Callbacks like
eventGenerator
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.
- abstract def publishAsync(eventGenerator: => Future[Option[Event]], every: FiniteDuration): Cancellable
Publish csw.params.events.Event from an asynchronous
eventGenerator
function, which will be executed atevery
frequency.Publish csw.params.events.Event from an asynchronous
eventGenerator
function, which will be executed atevery
frequency. This API is useful if your eventGenerator function generates an event asynchronously and returns a Future[Event].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, the stream receives a csw.event.api.exceptions.PublishFailure exception which wraps the underlying exception and also provides the handle to the event which was failed to be published.
- eventGenerator
a function which can generate a Future of event to be published at
every
frequency- every
frequency with which the events are to be published
- returns
a handle to cancel the event generation through
eventGenerator
- Note
Callbacks like
eventGenerator
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.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])