Class

de.heikoseeberger.akkasse

EventPublisher

Related Doc: package akkasse

Permalink

abstract class EventPublisher[A] extends ActorPublisher[ServerSentEvent]

Base class for an actor publishing events.

Concrete subclasses must implement receiveEvent which becomes part of the initial behavior, i.e. gets called by the provided receive implementation. Typically receiveEvent would be implemented simply be invoking onEvent which fist appends the received event (message) to the buffer which is limited by the bufferSize paramete – old events are discarded – and then publishes the buffered events up to the total demand if this publisher is active.

ActorPublisherMessage.Request is handled by publishing the buffered events up to the requested demand and other ActorPublisherMessages (e.g. Cancel) stop this actor.

If the heartbeatInterval is defined, a ServerSentEvent.heartbeat will be published if no other event has been received within that interval.

Attention: An implicit view A => ServerSentEvent has to be in scope!

Linear Supertypes
ActorPublisher[ServerSentEvent], Actor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. EventPublisher
  2. ActorPublisher
  3. Actor
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new EventPublisher(bufferSize: Int, heartbeatInterval: Duration = Duration.Undefined)(implicit arg0: ToServerSentEvent[A])

    Permalink

    bufferSize

    the maximum number of events (messages) to be buffered

    heartbeatInterval

    the interval for heartbeats; if Undefined, which is the default, no heartbeats are published

Type Members

  1. type Receive = PartialFunction[Any, Unit]

    Permalink
    Definition Classes
    Actor

Abstract Value Members

  1. abstract def receiveEvent: Receive

    Permalink

    To be implemented by invoking onEvent.

    To be implemented by invoking onEvent.

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def aroundPostRestart(reason: Throwable): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    ActorPublisher → Actor
  5. def aroundPostStop(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    ActorPublisher → Actor
  6. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    ActorPublisher → Actor
  7. def aroundPreStart(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    ActorPublisher → Actor
  8. def aroundReceive(receive: Receive, msg: Any): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    ActorPublisher → Actor
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. implicit val context: ActorContext

    Permalink
    Definition Classes
    Actor
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isActive: Boolean

    Permalink
    Definition Classes
    ActorPublisher
  18. final def isCanceled: Boolean

    Permalink
    Definition Classes
    ActorPublisher
  19. final def isCompleted: Boolean

    Permalink
    Definition Classes
    ActorPublisher
  20. final def isErrorEmitted: Boolean

    Permalink
    Definition Classes
    ActorPublisher
  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. def onComplete(): Unit

    Permalink
    Definition Classes
    ActorPublisher
  26. def onCompleteThenStop(): Unit

    Permalink
    Definition Classes
    ActorPublisher
  27. def onError(cause: Throwable): Unit

    Permalink
    Definition Classes
    ActorPublisher
  28. def onErrorThenStop(cause: Throwable): Unit

    Permalink
    Definition Classes
    ActorPublisher
  29. final def onEvent(event: A): Unit

    Permalink

    To be invoked when an event is received.

    To be invoked when an event is received.

    Attributes
    protected
  30. def onNext(element: ServerSentEvent): Unit

    Permalink
    Definition Classes
    ActorPublisher
  31. def postRestart(reason: Throwable): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  32. def postStop(): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  33. def preRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  34. def preStart(): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  35. final def receive: PartialFunction[Any, Unit]

    Permalink

    Receive events via onEvent and ActorPublisherMessages.

    Receive events via onEvent and ActorPublisherMessages.

    Definition Classes
    EventPublisher → Actor
  36. implicit final val self: ActorRef

    Permalink
    Definition Classes
    Actor
  37. final def sender(): ActorRef

    Permalink
    Definition Classes
    Actor
  38. def subscriptionTimeout: Duration

    Permalink
    Definition Classes
    ActorPublisher
  39. def supervisorStrategy: SupervisorStrategy

    Permalink
    Definition Classes
    Actor
  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  41. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  42. final def totalDemand: Long

    Permalink
    Definition Classes
    ActorPublisher
  43. def unhandled(message: Any): Unit

    Permalink
    Definition Classes
    Actor
  44. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ActorPublisher[ServerSentEvent]

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Ungrouped