Trait/Object

fs2.async.mutable

Topic

Related Docs: object Topic | package mutable

Permalink

trait Topic[F[_], A] extends AnyRef

Asynchronous Topic.

Topic allows you to distribute A published by arbitrary number of publishers to arbitrary number of subscribers.

Topic has built-in back-pressure support implemented as maximum bound (maxQueued) that a subscriber is allowed to enqueue. Once that bound is hit, publishing may semantically block until the lagging subscriber consumes some of its queued elements.

Additionally the subscriber has possibility to terminate whenever size of enqueued elements is over certain size by using subscribeSize.

Self Type
Topic[F, A]
Source
Topic.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Topic
  2. AnyRef
  3. 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

Abstract Value Members

  1. abstract def publish: Sink[F, A]

    Permalink

    Published any elements from source of A to this topic.

    Published any elements from source of A to this topic. If any of the subscribers reach its maxQueued limit, then this will hold to publish next element before that subscriber consumes it's elements or terminates.

  2. abstract def publish1(a: A): F[Unit]

    Permalink

    Publish one A to topic.

    Publish one A to topic.

    This will wait until A is published to all subscribers. If one of the subscribers is over the maxQueued limit, this will wait to complete until that subscriber processes some of its elements to get room for this new. published A

  3. abstract def subscribe(maxQueued: Int): Stream[F, A]

    Permalink

    Subscribes to receive any published A to this topic.

    Subscribes to receive any published A to this topic.

    Always returns last A published first, and then any next A published.

    If the subscriber is over maxQueued bound of messages awaiting to be processed, then publishers will hold into publishing to the queue.

  4. abstract def subscribeSize(maxQueued: Int): Stream[F, (A, Int)]

    Permalink

    Subscribes to receive published A to this topic.

    Subscribes to receive published A to this topic.

    Always returns last A published first, and then any next A available

    Additionally this emits current size of the queue of A for this subscriber allowing you to terminate (or adjust) the subscription if subscriber is way behind the elements available.

    Note that queue size is approximate and may not be exactly the size when A was taken.

    If the subscriber is over maxQueued bound of messages awaiting to be processed, then publishers will hold into publishing to the queue.

  5. abstract def subscribers: immutable.Signal[F, Int]

    Permalink

    Signal of current active subscribers

Concrete 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 Topic[F, A] to any2stringadd[Topic[F, A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Topic[F, A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Topic[F, A] to ArrowAssoc[Topic[F, A]] 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: (Topic[F, A]) ⇒ Boolean, msg: ⇒ Any): Topic[F, A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Topic[F, A] to Ensuring[Topic[F, A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (Topic[F, A]) ⇒ Boolean): Topic[F, A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Topic[F, A] to Ensuring[Topic[F, A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): Topic[F, A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Topic[F, A] to Ensuring[Topic[F, A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): Topic[F, A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Topic[F, A] to Ensuring[Topic[F, A]] 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 Topic[F, A] to StringFormat[Topic[F, A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  18. def imap[B](f: (A) ⇒ B)(g: (B) ⇒ A): Topic[F, B]

    Permalink

    Returns an alternate view of this Topic where its elements are of type B, given back and forth function from A to B.

  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. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. def [B](y: B): (Topic[F, A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Topic[F, A] to ArrowAssoc[Topic[F, A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Topic[F, A] to any2stringadd[Topic[F, A]]

Inherited by implicit conversion StringFormat from Topic[F, A] to StringFormat[Topic[F, A]]

Inherited by implicit conversion Ensuring from Topic[F, A] to Ensuring[Topic[F, A]]

Inherited by implicit conversion ArrowAssoc from Topic[F, A] to ArrowAssoc[Topic[F, A]]

Ungrouped