Class/Object

reactor.core.scala.publisher

Mono

Related Docs: object Mono | package publisher

Permalink

class Mono[T] extends Publisher[T] with MapablePublisher[T]

A Reactive Streams Publisher with basic rx operators that completes successfully by emitting an element, or with an error.

The rx operators will offer aliases for input Mono type to preserve the "at most one" property of the resulting Mono. For instance flatMap returns a Flux with possibly more than 1 emission. Its alternative enforcing Mono input is then.

Mono[Unit] should be used for Publisher that just completes without any value.

It is intended to be used in implementations and return types, input parameters should keep using raw Publisher as much as possible.

Note that using state in the scala.Function / lambdas used within Mono operators should be avoided, as these may be shared between several Subscribers.

T

the type of the single value of this class

See also

Flux

Linear Supertypes
MapablePublisher[T], Publisher[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Mono
  2. MapablePublisher
  3. Publisher
  4. AnyRef
  5. Any
  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. final def ++[T2](other: Mono[_ <: T2]): Mono[(T, T2)]

    Permalink

    An alias for Mono.and

    An alias for Mono.and

    T2

    the element type of the other Mono instance

    other

    the Mono to combine with

    returns

    a new combined Mono

    See also

    Mono.when

  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. final def and[T2, O](rightGenerator: (T) ⇒ Mono[T2], combinator: (T, T2) ⇒ O): Mono[O]

    Permalink

    Wait for the result from this mono, use it to create a second mono via the provided rightGenerator function and combine both results into an arbitrary O object, as defined by the provided combinator function.

    Wait for the result from this mono, use it to create a second mono via the provided rightGenerator function and combine both results into an arbitrary O object, as defined by the provided combinator function.

    T2

    the element type of the other Mono instance

    O

    the element type of the combination

    rightGenerator

    the scala.Function1 to generate a Mono to combine with

    combinator

    a scala.Function2 combinator function when both sources complete

    returns

    a new combined Mono

  6. final def and[T2](rightGenerator: (T) ⇒ Mono[T2]): Mono[(T, T2)]

    Permalink

    Wait for the result from this mono, use it to create a second mono via the provided rightGenerator function and combine both results into a scala.Tuple2.

    Wait for the result from this mono, use it to create a second mono via the provided rightGenerator function and combine both results into a scala.Tuple2.

    T2

    the element type of the other Mono instance

    rightGenerator

    the scala.Function1 to generate a Mono to combine with

    returns

    a new combined Mono

  7. final def and[T2, O](other: Mono[T2], combinator: (T, T2) ⇒ O): Mono[O]

    Permalink

    Combine the result from this mono and another into an arbitrary O object, as defined by the provided combinator function.

    Combine the result from this mono and another into an arbitrary O object, as defined by the provided combinator function.

    T2

    the element type of the other Mono instance

    O

    the element type of the combination

    other

    the Mono to combine with

    combinator

    a scala.Function2 combinator function when both sources complete

    returns

    a new combined Mono

    See also

    Mono.when

  8. final def and[T2](other: Mono[_ <: T2]): Mono[(T, T2)]

    Permalink

    Combine the result from this mono and another into a scala.Tuple2.

    Combine the result from this mono and another into a scala.Tuple2.

    T2

    the element type of the other Mono instance

    other

    the Mono to combine with

    returns

    a new combined Mono

    See also

    Mono.when

  9. final def as[P](transformer: (Mono[T]) ⇒ P): P

    Permalink

    Transform this Mono into a target type.

    Transform this Mono into a target type.

    mono.as(Flux::from).subscribe()

    P

    the returned instance type

    transformer

    the { @link Function} applying this { @link Mono}

    returns

    the transformed { @link Mono} to instance P

    See also

    Mono.compose for a bounded conversion to org.reactivestreams.Publisher

  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. final def asJava(): publisher.Mono[T]

    Permalink
  12. final def awaitOnSubscribe(): Mono[T]

    Permalink

    Intercepts the onSubscribe call and makes sure calls to Subscription methods only happen after the child Subscriber has returned from its onSubscribe method.

    Intercepts the onSubscribe call and makes sure calls to Subscription methods only happen after the child Subscriber has returned from its onSubscribe method.

    This helps with child Subscribers that don't expect a recursive call from onSubscribe into their onNext because, for example, they request immediately from their onSubscribe but don't finish their preparation before that and onNext runs into a half-prepared state. This can happen with non Reactor based Subscribers.

    returns

    non reentrant onSubscribe Mono

  13. final def block(timeout: Duration): T

    Permalink

    Block until a next signal is received, will return null if onComplete, T if onNext, throw a Exceptions.DownstreamException if checked error or origin RuntimeException if unchecked.

    Block until a next signal is received, will return null if onComplete, T if onNext, throw a Exceptions.DownstreamException if checked error or origin RuntimeException if unchecked. If the default timeout 30 seconds has elapsed,a RuntimeException will be thrown.

    Note that each block() will subscribe a new single (MonoSink) subscriber, in other words, the result might miss signal from hot publishers.

    timeout

    maximum time period to wait for before raising a RuntimeException

    returns

    T the result

  14. final def block(): T

    Permalink

    Block until a next signal is received, will return null if onComplete, T if onNext, throw a Exceptions.DownstreamException if checked error or origin RuntimeException if unchecked.

    Block until a next signal is received, will return null if onComplete, T if onNext, throw a Exceptions.DownstreamException if checked error or origin RuntimeException if unchecked.

    returns

    T the result

  15. final def cache(): Mono[T]

    Permalink

    Turn this Mono into a hot source and cache last emitted signals for further Subscriber.

    Turn this Mono into a hot source and cache last emitted signals for further Subscriber. Completion and Error will also be replayed.

    returns

    a replaying Mono

  16. final def cancelOn(scheduler: Scheduler): Mono[T]

    Permalink

    Prepare this Mono so that subscribers will cancel from it on a specified reactor.core.scheduler.Scheduler.

    Prepare this Mono so that subscribers will cancel from it on a specified reactor.core.scheduler.Scheduler.

    scheduler

    the reactor.core.scheduler.Scheduler to signal cancel on

    returns

    a scheduled cancel Mono

  17. final def cast[E](clazz: Class[E]): Mono[E]

    Permalink

    Cast the current Mono produced type into a target produced type.

    Cast the current Mono produced type into a target produced type.

    E

    the { @link Mono} output type

    clazz

    the target type to cast to

    returns

    a casted Mono

  18. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def compose[V](transformer: (Mono[T]) ⇒ Publisher[V]): Mono[V]

    Permalink

    Defer the given transformation to this Mono in order to generate a target Mono type.

    Defer the given transformation to this Mono in order to generate a target Mono type. A transformation will occur for each org.reactivestreams.Subscriber.

    flux.compose(Mono::from).subscribe()

    V

    the item type in the returned org.reactivestreams.Publisher

    transformer

    the function to immediately map this Mono into a target Mono instance.

    returns

    a new Mono

    See also

    Mono.as for a loose conversion to an arbitrary type

  20. final def concatWith(other: Publisher[T]): Flux[T]

    Permalink

    Concatenate emissions of this Mono with the provided Publisher (no interleave).

    Concatenate emissions of this Mono with the provided Publisher (no interleave).

    other

    the Publisher sequence to concat after this Flux

    returns

    a concatenated Flux

  21. final def defaultIfEmpty(defaultV: T): Mono[T]

    Permalink

    Provide a default unique value if this mono is completed without any data

    Provide a default unique value if this mono is completed without any data

    defaultV

    the alternate value if this sequence is empty

    returns

    a new Mono

    See also

    Flux.defaultIfEmpty

  22. final def delaySubscription[U](subscriptionDelay: Publisher[U]): Mono[T]

    Permalink

    Delay the subscription to this Mono until another Publisher signals a value or completes.

    Delay the subscription to this Mono until another Publisher signals a value or completes.

    U

    the other source type

    subscriptionDelay

    a Publisher to signal by next or complete this Mono.subscribe

    returns

    a delayed Mono

  23. final def delaySubscription(delay: Duration, timer: Scheduler): Mono[T]

    Permalink

    Delay the subscription to this Mono source until the given Duration elapses.

    Delay the subscription to this Mono source until the given Duration elapses.

    delay

    Duration before subscribing this Mono

    timer

    a time-capable Scheduler instance to run on

    returns

    a delayed Mono

  24. final def delaySubscription(delay: Duration): Mono[T]

    Permalink

    Delay the subscription to this Mono source until the given period elapses.

    Delay the subscription to this Mono source until the given period elapses.

    delay

    duration before subscribing this Mono

    returns

    a delayed Mono

  25. final def dematerialize[X](): Mono[X]

    Permalink

    A "phantom-operator" working only if this Mono is a emits onNext, onError or onComplete reactor.core.publisher.Signal.

    A "phantom-operator" working only if this Mono is a emits onNext, onError or onComplete reactor.core.publisher.Signal. The relative org.reactivestreams.Subscriber callback will be invoked, error reactor.core.publisher.Signal will trigger onError and complete reactor.core.publisher.Signal will trigger onComplete.

    X

    the dematerialized type

    returns

    a dematerialized Mono

  26. final def doAfterTerminate(afterTerminate: Function2[_ >: T, Throwable, Unit]): Mono[T]

    Permalink

    Triggered after the Mono terminates, either by completing downstream successfully or with an error.

    Triggered after the Mono terminates, either by completing downstream successfully or with an error. The arguments will be null depending on success, success with data and error:

    • null, null : completed without data
    • T, null : completed with data
    • null, Throwable : failed with/without data

    afterTerminate

    the callback to call after org.reactivestreams.Subscriber.onNext, org.reactivestreams.Subscriber.onComplete without preceding org.reactivestreams.Subscriber.onNext or org.reactivestreams.Subscriber.onError

    returns

    a new Mono

  27. final def doFinally(onFinally: (SignalType) ⇒ Unit): Mono[T]

    Permalink
  28. final def doOnCancel(onCancel: () ⇒ Unit): Mono[T]

    Permalink

    Triggered when the Mono is cancelled.

    Triggered when the Mono is cancelled.

    onCancel

    the callback to call on org.reactivestreams.Subscriber.cancel

    returns

    a new Mono

  29. final def doOnError(predicate: (Throwable) ⇒ Boolean, onError: (Throwable) ⇒ Unit): Mono[T]

    Permalink

    Triggered when the Mono completes with an error matching the given exception.

    Triggered when the Mono completes with an error matching the given exception.

    predicate

    the matcher for exceptions to handle

    onError

    the error handler for each error

    returns

    an observed Mono

  30. final def doOnError[E <: Throwable](exceptionType: Class[E], onError: (E) ⇒ Unit): Mono[T]

    Permalink

    Triggered when the Mono completes with an error matching the given exception type.

    Triggered when the Mono completes with an error matching the given exception type.

    E

    type of the error to handle

    exceptionType

    the type of exceptions to handle

    onError

    the error handler for each error

    returns

    an observed Mono

  31. final def doOnError(onError: (Throwable) ⇒ Unit): Mono[T]

    Permalink

    Triggered when the Mono completes with an error.

    Triggered when the Mono completes with an error.

    onError

    the error callback to call on org.reactivestreams.Subscriber.onError

    returns

    a new Mono

  32. final def doOnNext(onNext: (T) ⇒ Unit): Mono[T]

    Permalink
  33. final def doOnRequest(consumer: (Long) ⇒ Unit): Mono[T]

    Permalink

    Attach a Long consumer to this Mono that will observe any request to this Mono.

    Attach a Long consumer to this Mono that will observe any request to this Mono.

    consumer

    the consumer to invoke on each request

    returns

    an observed Mono

  34. final def doOnSubscribe(onSubscribe: (Subscription) ⇒ Unit): Mono[T]

    Permalink

    Triggered when the Mono is subscribed.

    Triggered when the Mono is subscribed.

    onSubscribe

    the callback to call on Subscriber#onSubscribe

    returns

    a new Mono

  35. final def doOnSuccess(onSuccess: (T) ⇒ Unit): Mono[T]

    Permalink

    Triggered when the Mono completes successfully.

    Triggered when the Mono completes successfully.

    • null : completed without data
    • T: completed with data

    onSuccess

    the callback to call on, argument is null if the Mono completes without data org.reactivestreams.Subscriber.onNext or org.reactivestreams.Subscriber.onComplete without preceding org.reactivestreams.Subscriber.onNext

    returns

    a new Mono

  36. final def doOnTerminate(onTerminate: (T, Throwable) ⇒ Unit): Mono[T]

    Permalink

    Triggered when the Mono terminates, either by completing successfully or with an error.

    Triggered when the Mono terminates, either by completing successfully or with an error.

    • null, null : completing without data
    • T, null : completing with data
    • null, Throwable : failing with/without data

    onTerminate

    the callback to call Subscriber.onNext, Subscriber.onComplete without preceding Subscriber.onNext or Subscriber.onError

    returns

    a new Mono

  37. final def elapsed(scheduler: Scheduler): Mono[(Long, T)]

    Permalink

    Map this Mono sequence into scala.Tuple2 of T1 Long timemillis and T2 T associated data.

    Map this Mono sequence into scala.Tuple2 of T1 Long timemillis and T2 T associated data. The timemillis corresponds to the elapsed time between the subscribe and the first next signal.

    scheduler

    the Scheduler to read time from

    returns

    a transforming Mono that emits a tuple of time elapsed in milliseconds and matching data

  38. final def elapsed(): Mono[(Long, T)]

    Permalink

    Map this Mono sequence into scala.Tuple2 of T1 Long timemillis and T2 T associated data.

    Map this Mono sequence into scala.Tuple2 of T1 Long timemillis and T2 T associated data. The timemillis corresponds to the elapsed time between the subscribe and the first next signal.

    returns

    a transforming Monothat emits a tuple of time elapsed in milliseconds and matching data

  39. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  41. final def filter(tester: (T) ⇒ Boolean): Mono[T]

    Permalink

    Test the result if any of this Mono and replay it if predicate returns true.

    Test the result if any of this Mono and replay it if predicate returns true. Otherwise complete without value.

    tester

    the predicate to evaluate

    returns

    a filtered Mono

  42. final def filterWhen(asyncPredicate: Function1[T, _ <: Publisher[Boolean] with MapablePublisher[Boolean]]): Mono[T]

    Permalink

    If this Mono is valued, test the value asynchronously using a generated Publisher[Boolean] test.

    If this Mono is valued, test the value asynchronously using a generated Publisher[Boolean] test. The value from the Mono is replayed if the first item emitted by the test is true. It is dropped if the test is either empty or its first emitted value is false.

    Note that only the first value of the test publisher is considered, and unless it is a Mono, test will be cancelled after receiving that first value.

    asyncPredicate

    the function generating a Publisher of Boolean to filter the Mono with

    returns

    a filtered Mono

  43. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  44. final def flatMap[R](mapperOnNext: (T) ⇒ Publisher[R], mapperOnError: (Throwable) ⇒ Publisher[R], mapperOnComplete: () ⇒ Publisher[R]): Flux[R]

    Permalink

    Transform the signals emitted by this Mono into a Publisher, then forward its emissions into the returned Flux.

    Transform the signals emitted by this Mono into a Publisher, then forward its emissions into the returned Flux.

    R

    the type of the produced inner sequence

    mapperOnNext

    the Function1 to call on next data and returning a sequence to merge

    mapperOnError

    theFunction1 to call on error signal and returning a sequence to merge

    mapperOnComplete

    the Function1 to call on complete signal and returning a sequence to merge

    returns

    a new Flux as the sequence is not guaranteed to be single at most

    See also

    Flux.flatMap

  45. final def flatMap[R](mapper: (T) ⇒ Publisher[R]): Flux[R]

    Permalink

    Transform the item emitted by this Mono into a Publisher, then forward its emissions into the returned Flux.

    Transform the item emitted by this Mono into a Publisher, then forward its emissions into the returned Flux.

    R

    the merged sequence type

    mapper

    the Function1 to produce a sequence of R from the the eventual passed Subscriber.onNext

    returns

    a new Flux as the sequence is not guaranteed to be single at most

  46. final def flatMapIterable[R](mapper: (T) ⇒ Iterable[R]): Flux[R]

    Permalink

    Transform the item emitted by this Mono into Iterable, , then forward its elements into the returned Flux.

    Transform the item emitted by this Mono into Iterable, , then forward its elements into the returned Flux. The prefetch argument allows to give an arbitrary prefetch size to the inner Iterable.

    R

    the merged output sequence type

    mapper

    the Function1 to transform input item into a sequence Iterable

    returns

    a merged Flux

  47. final def flux(): Flux[T]

    Permalink

    Convert this Mono to a Flux

    Convert this Mono to a Flux

    returns

    a Flux variant of this Mono

  48. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  49. final def handle[R](handler: (T, SynchronousSink[R]) ⇒ Unit): Mono[R]

    Permalink
  50. final def hasElement: Mono[Boolean]

    Permalink
  51. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  52. final def hide: Mono[T]

    Permalink
  53. final def ignoreElement: Mono[T]

    Permalink
  54. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  55. implicit def jMonoVoid2jMonoUnit(jMonoVoid: publisher.Mono[Void]): publisher.Mono[Unit]

    Permalink
  56. val javaTupleLongAndT2ScalaTupleLongAndT: Function[Tuple2[Long, T], (Long, T)]

    Permalink
  57. final def log(category: String, level: Level, showOperatorLine: Boolean, options: SignalType*): Mono[T]

    Permalink
  58. final def log(category: String, level: Level, options: SignalType*): Mono[T]

    Permalink
  59. final def log(category: String): Mono[T]

    Permalink
  60. final def log: Mono[T]

    Permalink
  61. final def map[R](mapper: (T) ⇒ R): Mono[R]

    Permalink
    Definition Classes
    MonoMapablePublisher
  62. final def mapError(predicate: (Throwable) ⇒ Boolean, mapper: (Throwable) ⇒ Throwable): Mono[T]

    Permalink
  63. final def mapError[E <: Throwable](type: Class[E], mapper: (E) ⇒ Throwable): Mono[T]

    Permalink
  64. final def mapError(mapper: (Throwable) ⇒ Throwable): Mono[T]

    Permalink
  65. final def materialize(): Mono[Signal[T]]

    Permalink
  66. final def mergeWith(other: Publisher[_ <: T]): Flux[T]

    Permalink

    Merge emissions of this Mono with the provided Publisher.

    Merge emissions of this Mono with the provided Publisher.

    other

    the other Publisher to merge with

    returns

    a new Flux as the sequence is not guaranteed to be at most 1

  67. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  70. final def ofType[U](clazz: Class[U]): Mono[U]

    Permalink
  71. final def onTerminateDetach(): Mono[T]

    Permalink
  72. final def or(other: Mono[_ <: T]): Mono[T]

    Permalink
  73. final def otherwise(predicate: (Throwable) ⇒ Boolean, fallback: (Throwable) ⇒ Mono[_ <: T]): Mono[T]

    Permalink
  74. final def otherwise[E <: Throwable](type: Class[E], fallback: (E) ⇒ Mono[_ <: T]): Mono[T]

    Permalink
  75. final def otherwise(fallback: (Throwable) ⇒ Mono[_ <: T]): Mono[T]

    Permalink
  76. final def otherwiseIfEmpty(alternate: Mono[_ <: T]): Mono[T]

    Permalink
  77. final def otherwiseReturn(predicate: (Throwable) ⇒ Boolean, fallback: T): Mono[T]

    Permalink
  78. final def otherwiseReturn[E <: Throwable](type: Class[E], fallback: T): Mono[T]

    Permalink
  79. final def otherwiseReturn(fallback: T): Mono[T]

    Permalink
  80. final def publish[R](transform: (Mono[T]) ⇒ Mono[R]): Mono[R]

    Permalink
  81. final def publishOn(scheduler: Scheduler): Mono[T]

    Permalink
  82. final def repeat(numRepeat: Long, predicate: () ⇒ Boolean): Flux[T]

    Permalink

    Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.

    Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription. A specified maximum of repeat will limit the number of re-subscribe.

    numRepeat

    the number of times to re-subscribe on complete

    predicate

    the boolean to evaluate on onComplete

    returns

    an eventually repeated Flux on onComplete up to number of repeat specified OR matching predicate

  83. final def repeat(numRepeat: Long): Flux[T]

    Permalink

    Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.

    Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.

    numRepeat

    the number of times to re-subscribe on onComplete

    returns

    an eventually repeated Flux on onComplete up to number of repeat specified

  84. final def repeat(predicate: () ⇒ Boolean): Flux[T]

    Permalink

    Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.

    Repeatedly subscribe to the source if the predicate returns true after completion of the previous subscription.

    predicate

    the boolean to evaluate on onComplete.

    returns

    an eventually repeated Flux on onComplete

  85. final def repeat(): Flux[T]

    Permalink

    Repeatedly subscribe to the source completion of the previous subscription.

    Repeatedly subscribe to the source completion of the previous subscription.

    returns

    an indefinitively repeated Flux on onComplete

  86. final def repeatWhen(whenFactory: Function1[Flux[Long], _ <: Publisher[_]]): Flux[T]

    Permalink

    Repeatedly subscribe to this Mono when a companion sequence signals a number of emitted elements in response to the flux completion signal.

    Repeatedly subscribe to this Mono when a companion sequence signals a number of emitted elements in response to the flux completion signal.

    If the companion sequence signals when this Mono is active, the repeat attempt is suppressed and any terminal signal will terminate this Flux with the same signal immediately.

    whenFactory

    the Function1 providing a Flux signalling an exclusive number of emitted elements on onComplete and returning a Publisher companion.

    returns

    an eventually repeated Flux on onComplete when the companion Publisher produces an onNext signal

  87. final def repeatWhenEmpty(maxRepeat: Int, repeatFactory: (Flux[Long]) ⇒ Publisher[_]): Mono[T]

    Permalink
  88. final def repeatWhenEmpty(repeatFactory: (Flux[Long]) ⇒ Publisher[_]): Mono[T]

    Permalink
  89. final def retry(numRetries: Long, retryMatcher: (Throwable) ⇒ Boolean): Mono[T]

    Permalink
  90. final def retry(retryMatcher: (Throwable) ⇒ Boolean): Mono[T]

    Permalink
  91. final def retry(numRetries: Long): Mono[T]

    Permalink
  92. final def retry(): Mono[T]

    Permalink
  93. final def retryWhen(whenFactory: (Flux[Throwable]) ⇒ Publisher[_]): Mono[T]

    Permalink
  94. final def subscribe(consumer: (T) ⇒ Unit, errorConsumer: (Throwable) ⇒ Unit, completeConsumer: ⇒ Unit, subscriptionConsumer: (Subscription) ⇒ Unit): Disposable

    Permalink
  95. final def subscribe(consumer: (T) ⇒ Unit, errorConsumer: (Throwable) ⇒ Unit, completeConsumer: ⇒ Unit): Disposable

    Permalink
  96. final def subscribe(consumer: (T) ⇒ Unit, errorConsumer: (Throwable) ⇒ Unit): Disposable

    Permalink

    Subscribe Consumer to this Mono that will consume all the sequence.

    Subscribe Consumer to this Mono that will consume all the sequence.

    For a passive version that observe and forward incoming data see Mono.doOnSuccess and Mono.doOnError.

    consumer

    the consumer to invoke on each next signal

    errorConsumer

    the consumer to invoke on error signal

    returns

    a new Runnable to dispose the org.reactivestreams.Subscription

  97. final def subscribe(consumer: (T) ⇒ Unit): Disposable

    Permalink
  98. final def subscribe(): MonoProcessor[T]

    Permalink
  99. def subscribe(s: Subscriber[_ >: T]): Unit

    Permalink
    Definition Classes
    Mono → Publisher
  100. final def subscribeOn(scheduler: Scheduler): Mono[T]

    Permalink
  101. final def subscribeWith[E <: Subscriber[_ >: T]](subscriber: E): E

    Permalink
  102. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  103. final def then[R](sourceSupplier: Function0[_ <: Mono[R]]): Mono[R]

    Permalink
  104. final def then[R](other: Mono[R]): Mono[R]

    Permalink
  105. final def then[R](transformer: (T) ⇒ Mono[R]): Mono[R]

    Permalink
  106. final def then(): Mono[Unit]

    Permalink
  107. final def thenEmpty(other: Publisher[Unit]): Mono[Unit]

    Permalink
  108. final def thenMany[V](afterSupplier: () ⇒ Publisher[V]): Flux[V]

    Permalink

    Ignore element from this mono and transform the completion signal into a Flux[V] that will emit elements from the supplier-provided Publisher.

    Ignore element from this mono and transform the completion signal into a Flux[V] that will emit elements from the supplier-provided Publisher.

    V

    the element type of the supplied Publisher

    afterSupplier

    a supplier of Publisher to emit from after completion

    returns

    a new Flux that emits from the supplied Publisher

  109. final def thenMany[V](other: Publisher[V]): Flux[V]

    Permalink

    Ignore element from this mono and transform the completion signal into a Flux[V] that will emit elements from the provided Publisher.

    Ignore element from this mono and transform the completion signal into a Flux[V] that will emit elements from the provided Publisher.

    V

    the element type of the supplied Publisher

    other

    a Publisher to emit from after termination

    returns

    a new Flux that emits from the supplied Publisher after this Mono completes.

  110. final def timeout[U](firstTimeout: Publisher[U], fallback: Mono[_ <: T]): Mono[T]

    Permalink

    Switch to a fallback Publisher in case the item from this Mono has not been emitted before the given Publisher emits.

    Switch to a fallback Publisher in case the item from this Mono has not been emitted before the given Publisher emits. The following items will be individually timed via the factory provided Publisher.

    U

    the element type of the timeout Publisher

    firstTimeout

    the timeout Publisher that must not emit before the first signal from this Mono

    fallback

    the fallback Publisher to subscribe when a timeout occurs

    returns

    a first then per-item expirable Mono with a fallback Publisher

  111. final def timeout[U](firstTimeout: Publisher[U]): Mono[T]

    Permalink

    Signal a java.util.concurrent.TimeoutException in case the item from this Mono has not been emitted before the given Publisher emits.

    Signal a java.util.concurrent.TimeoutException in case the item from this Mono has not been emitted before the given Publisher emits.

    U

    the element type of the timeout Publisher

    firstTimeout

    the timeout Publisher that must not emit before the first signal from this Mono

    returns

    an expirable Mono if the first item does not come before a Publisher signal

  112. final def timeout(timeout: Duration, fallback: Option[Mono[_ <: T]], timer: Scheduler): Mono[T]

    Permalink

    Switch to a fallback Mono in case an item doesn't arrive before the given period.

    Switch to a fallback Mono in case an item doesn't arrive before the given period.

    If the given Publisher is None, signal a java.util.concurrent.TimeoutException.

    timeout

    the timeout before the onNext signal from this Mono

    fallback

    the fallback Mono to subscribe when a timeout occurs

    timer

    a time-capable Scheduler instance to run on

    returns

    an expirable Mono with a fallback Mono

  113. final def timeout(timeout: Duration, timer: Scheduler): Mono[T]

    Permalink

    Signal a java.util.concurrent.TimeoutException error in case an item doesn't arrive before the given period.

    Signal a java.util.concurrent.TimeoutException error in case an item doesn't arrive before the given period.

    timeout

    the timeout before the onNext signal from this Mono

    timer

    a time-capable Scheduler instance to run on

    returns

    an expirable Mono

  114. final def timeout(timeout: Duration, fallback: Option[Mono[_ <: T]]): Mono[T]

    Permalink

    Switch to a fallback Mono in case an item doesn't arrive before the given period.

    Switch to a fallback Mono in case an item doesn't arrive before the given period.

    If the given Publisher is null, signal a java.util.concurrent.TimeoutException.

    timeout

    the timeout before the onNext signal from this Mono

    fallback

    the fallback Mono to subscribe when a timeout occurs

    returns

    an expirable Mono with a fallback Mono

  115. final def timeout(timeout: Duration): Mono[T]

    Permalink

    Signal a java.util.concurrent.TimeoutException in case an item doesn't arrive before the given period.

    Signal a java.util.concurrent.TimeoutException in case an item doesn't arrive before the given period.

    timeout

    the timeout before the onNext signal from this Mono

    returns

    an expirable Mono}

  116. final def timestamp(scheduler: Scheduler): Mono[(Long, T)]

    Permalink

    Emit a Tuple2 pair of T1 Long current system time in millis and T2 T associated data for the eventual item from this Mono

    Emit a Tuple2 pair of T1 Long current system time in millis and T2 T associated data for the eventual item from this Mono

    scheduler

    a Scheduler instance to read time from

    returns

    a timestamped Mono

  117. final def timestamp(): Mono[(Long, T)]

    Permalink

    Emit a Tuple2 pair of T1 Long current system time in millis and T2 T associated data for the eventual item from this Mono

    Emit a Tuple2 pair of T1 Long current system time in millis and T2 T associated data for the eventual item from this Mono

    returns

    a timestamped Mono

  118. final def toFuture: Future[T]

    Permalink

    Transform this Mono into a Future completing on onNext or onComplete and failing on onError.

    Transform this Mono into a Future completing on onNext or onComplete and failing on onError.

    returns

    a Future

  119. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  120. final def transform[V](transformer: (Mono[T]) ⇒ Publisher[V]): Mono[V]

    Permalink

    Transform this Mono in order to generate a target Mono.

    Transform this Mono in order to generate a target Mono. Unlike Mono.compose, the provided function is executed as part of assembly.

    V

    the item type in the returned Mono

    transformer

    the Function1 to immediately map this Mono into a target Mono instance.

    returns

    a new Mono

    Example:
    1. val applySchedulers = mono => mono.subscribeOn(Schedulers.elastic()).publishOn(Schedulers.parallel());
      mono.transform(applySchedulers).map(v => v * v).subscribe()
    See also

    Mono.as for a loose conversion to an arbitrary type

    Mono.compose for deferred composition of Mono for each Subscriber

  121. def untilOther(anyPublisher: Publisher[_]): Mono[T]

    Permalink

    Subscribe to this Mono and another Publisher, which will be used as a trigger for the emission of this Mono's element.

    Subscribe to this Mono and another Publisher, which will be used as a trigger for the emission of this Mono's element. That is to say, this Mono's element is delayed until the trigger Publisher emits for the first time (or terminates empty).

    anyPublisher

    the publisher which first emission or termination will trigger the emission of this Mono's value.

    returns

    this Mono, but delayed until the given publisher emits first or terminates.

  122. def untilOtherDelayError(anyPublisher: Publisher[_]): Mono[T]

    Permalink

    Subscribe to this Mono and another Publisher, which will be used as a trigger for the emission of this Mono's element, mapped through a provided function.

    Subscribe to this Mono and another Publisher, which will be used as a trigger for the emission of this Mono's element, mapped through a provided function. That is to say, this Mono's element is delayed until the trigger Publisher emits for the first time (or terminates empty). Any error is delayed until all publishers have triggered, and multiple errors are combined into one.

    anyPublisher

    the publisher which first emission or termination will trigger the emission of this Mono's value.

    returns

    this Mono, but delayed until the given publisher emits first or terminates.

  123. final def wait(): Unit

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

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

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

Inherited from MapablePublisher[T]

Inherited from Publisher[T]

Inherited from AnyRef

Inherited from Any

Ungrouped