Packages

final class PubSubRef[T] extends NoSerializationVerificationNeeded

A PubSubRef represents a publish/subscribe topic.

Messages can be published to the topic via a stream by using the Source returned by the #publisher method. A single message can be published with the #publish method.

Messages can be consumed from the topic via a stream by using the Sink returned by the #subscriber method.

The registry of subscribers is eventually consistent, i.e. new subscribers are not immediately visible at other nodes, but typically the information will be fully replicated to all other nodes after a few seconds.

New subscribers will not see old messages that were published to the topic, i.e. it is only a live stream of messages.

Messages are not guaranteed to be delivered, i.e. they may be lost. That can for example happen if there is a transient network partition.

The subscriber has a buffer of received messages, but messages will be dropped if that buffer is full and demand for more elements have not been requested from downstream. This can happen if a subscriber is slower than the publishers of the messages. When the buffer is full the oldest messages are dropped to make room for new messages.

Source
PubSubRef.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PubSubRef
  2. NoSerializationVerificationNeeded
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from PubSubRef[T] to any2stringadd[PubSubRef[T]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (PubSubRef[T], B)
    Implicit
    This member is added by an implicit conversion from PubSubRef[T] to ArrowAssoc[PubSubRef[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. def ensuring(cond: (PubSubRef[T]) ⇒ Boolean, msg: ⇒ Any): PubSubRef[T]
    Implicit
    This member is added by an implicit conversion from PubSubRef[T] to Ensuring[PubSubRef[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (PubSubRef[T]) ⇒ Boolean): PubSubRef[T]
    Implicit
    This member is added by an implicit conversion from PubSubRef[T] to Ensuring[PubSubRef[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): PubSubRef[T]
    Implicit
    This member is added by an implicit conversion from PubSubRef[T] to Ensuring[PubSubRef[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): PubSubRef[T]
    Implicit
    This member is added by an implicit conversion from PubSubRef[T] to Ensuring[PubSubRef[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from PubSubRef[T] to StringFormat[PubSubRef[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hasAnySubscribers(): Future[Boolean]

    Request if this topic has any known subscribers at this point.

    Request if this topic has any known subscribers at this point. The Future is completed with the currently known information at this node, i.e. completion is not deferred until there are subscribers.

    Note that the registry of subscribers is eventually consistent, i.e. new subscribers are not immediately visible at other nodes, but typically the information will be fully replicated to all other nodes after a few seconds.

    This method is especially useful when writing tests that require that a subscriber is known before sending messages to a topic.

  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. def publish(message: T): Unit
  24. def publisher: Sink[T, NotUsed]

    Publish messages from a stream to the topic.

    Publish messages from a stream to the topic. You have to connect a Source that produces the messages to this Sink and then run the stream.

  25. def subscriber: Source[T, NotUsed]

    Consume messages from the topic via a stream.

    Consume messages from the topic via a stream. You can return this Source as a response in a ServiceCall and the elements will be streamed to the client. Otherwise you have to connect a Sink that consumes the messages from this Source and then run the stream.

  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    PubSubRef → AnyRef → Any
  28. val topic: TopicId[T]
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  32. def writeReplace(): AnyRef
    Attributes
    protected
    Annotations
    @throws( ... )
  33. def [B](y: B): (PubSubRef[T], B)
    Implicit
    This member is added by an implicit conversion from PubSubRef[T] to ArrowAssoc[PubSubRef[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from PubSubRef[T] to any2stringadd[PubSubRef[T]]

Inherited by implicit conversion StringFormat from PubSubRef[T] to StringFormat[PubSubRef[T]]

Inherited by implicit conversion Ensuring from PubSubRef[T] to Ensuring[PubSubRef[T]]

Inherited by implicit conversion ArrowAssoc from PubSubRef[T] to ArrowAssoc[PubSubRef[T]]

Ungrouped