Class

com.lightbend.lagom.scaladsl.pubsub

PubSubRef

Related Doc: package pubsub

Permalink

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
Linear Supertypes
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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    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)

    Permalink
    Implicit information
    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

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (PubSubRef[T]) ⇒ Boolean, msg: ⇒ Any): PubSubRef[T]

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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

    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. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    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[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hasAnySubscribers(): Future[Boolean]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef
  23. def publish(message: T): Unit

    Permalink
  24. def publisher: Sink[T, NotUsed]

    Permalink

    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]

    Permalink

    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

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

    Permalink
    Definition Classes
    PubSubRef → AnyRef → Any
  28. val topic: TopicId[T]

    Permalink
  29. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def writeReplace(): AnyRef

    Permalink
    Attributes
    protected
    Annotations
    @throws( ... )
  33. def [B](y: B): (PubSubRef[T], B)

    Permalink
    Implicit information
    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