Class/Object

reactor.core.scala.publisher

Mono

Related Docs: object Mono | package publisher

Permalink

class Mono[T] extends Publisher[T] with MapablePublisher[T] with OnErrorReturn[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
OnErrorReturn[T], MapablePublisher[T], Publisher[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Mono
  2. OnErrorReturn
  3. MapablePublisher
  4. Publisher
  5. AnyRef
  6. 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 ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def and(other: Publisher[_]): Mono[Unit]

    Permalink

    Join the termination signals from this mono and another source into the returned void mono

    Join the termination signals from this mono and another source into the returned void mono

    other

    the Publisher to wait for complete

    returns

    a new combined Mono

    See also

    Mono.when

  5. 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

  6. final def asInstanceOf[T0]: T0

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

    Permalink
  8. 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

  9. 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

  10. 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

  11. final def cache(ttl: Duration): Mono[T]

    Permalink
  12. 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

  13. 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

  14. 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

  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. 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

  17. 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

  18. 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

  19. final def delayElement(delay: Duration, timer: Scheduler): Mono[T]

    Permalink

    Delay this Mono element (Subscriber.onNext signal) by a given Duration, on a particular Scheduler.

    Delay this Mono element (Subscriber.onNext signal) by a given Duration, on a particular Scheduler. Empty monos or error signals are not delayed.

    Note that the scheduler on which the mono chain continues execution will be the scheduler provided if the mono is valued, or the current scheduler if the mono completes empty or errors.

    delay

    Duration by which to delay the { @link Subscriber#onNext} signal

    timer

    a time-capable Scheduler instance to delay the value signal on

    returns

    a delayed Mono

  20. final def delayElement(delay: Duration): Mono[T]

    Permalink

    Delay this Mono element (Subscriber.onNext signal) by a given duration.

    Delay this Mono element (Subscriber.onNext signal) by a given duration. Empty Monos or error signals are not delayed.

    Note that the scheduler on which the Mono chain continues execution will be the parallel scheduler if the mono is valued, or the current scheduler if the mono completes empty or errors.

    delay

    duration by which to delay the Subscriber.onNext signal

    returns

    a delayed Mono

  21. 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

  22. 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

  23. 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

  24. final def delayUntil(triggerProvider: (T) ⇒ Publisher[_]): Mono[T]

    Permalink

    Subscribe to this Mono and another Publisher that is generated from this Mono's element and which will be used as a trigger for relaying said element.

    Subscribe to this Mono and another Publisher that is generated from this Mono's element and which will be used as a trigger for relaying said element.

    That is to say, the resulting Mono delays until this Mono's element is emitted, generates a trigger Publisher and then delays again until the trigger Publisher terminates.

    Note that contiguous calls to all delayUntil are fused together. The triggers are generated and subscribed to in sequence, once the previous trigger completes. Error is propagated immediately downstream. In both cases, an error in the source is immediately propagated.

    triggerProvider

    a Function1 that maps this Mono's value into a Publisher whose termination will trigger relaying the value.

    returns

    this Mono, but delayed until the derived publisher terminates.

  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 doAfterSuccessOrError(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 doAfterTerminate(afterTerminate: () ⇒ Unit): Mono[T]

    Permalink

    Add behavior (side-effect) triggered after the Mono terminates, either by completing downstream successfully or with an error.

    Add behavior (side-effect) triggered after the Mono terminates, either by completing downstream successfully or with an error.

    afterTerminate

    the callback to call after Subscriber.onComplete or Subscriber.onError

    returns

    an observed Flux

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

    Permalink
  29. 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

  30. 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

  31. 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

  32. 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

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

    Permalink
  34. 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

  35. 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

  36. 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

  37. final def doOnTerminate(onTerminate: () ⇒ Unit): Mono[T]

    Permalink

    Add behavior triggered when the Mono terminates, either by completing successfully or with an error.

    Add behavior triggered when the Mono terminates, either by completing successfully or with an error.

    onTerminate

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

    returns

    a new Mono

  38. 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

  39. 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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  42. final def expand(expander: (T) ⇒ Publisher[_ <: T]): Flux[T]

    Permalink

    Recursively expand elements into a graph and emit all the resulting element using a breadth-first traversal strategy.

    Recursively expand elements into a graph and emit all the resulting element using a breadth-first traversal strategy.

    That is: emit the value from this Mono first, then it each at a first level of recursion and emit all of the resulting values, then expand all of these at a second level and so on...

    For example, given the hierarchical structure

    A
      - AA
        - aa1
      - AB
        - ab1
      - a1
    

    Expands Mono.just(A) into

    A
    AA
    AB
    a1
    aa1
    ab1
    

    expander

    the Function1 applied at each level of recursion to expand values into a Publisher, producing a graph.

    returns

    this Mono expanded breadth-first to a Flux

  43. final def expand(expander: (T) ⇒ Publisher[_ <: T], capacityHint: Int): Flux[T]

    Permalink

    Recursively expand elements into a graph and emit all the resulting element using a breadth-first traversal strategy.

    Recursively expand elements into a graph and emit all the resulting element using a breadth-first traversal strategy.

    That is: emit the value from this Mono first, then it each at a first level of recursion and emit all of the resulting values, then expand all of these at a second level and so on...

    For example, given the hierarchical structure

    A
      - AA
        - aa1
      - AB
        - ab1
      - a1
    

    Expands Mono.just(A) into

    A
    AA
    AB
    a1
    aa1
    ab1
    

    expander

    the Function1 applied at each level of recursion to expand values into a Publisher, producing a graph.

    capacityHint

    a capacity hint to prepare the inner queues to accommodate n elements per level of recursion.

    returns

    this Mono expanded breadth-first to a Flux

  44. final def expandDeep(expander: (T) ⇒ Publisher[_ <: T]): Flux[T]

    Permalink

    Recursively expand elements into a graph and emit all the resulting element, in a depth-first traversal order.

    Recursively expand elements into a graph and emit all the resulting element, in a depth-first traversal order.

    That is: emit the value from this Mono, expand it and emit the first value at this first level of recursion, and so on... When no more recursion is possible, backtrack to the previous level and re-apply the strategy.

    For example, given the hierarchical structure

    A
      - AA
        - aa1
      - AB
        - ab1
      - a1
    

    Expands Mono.just(A) into

    A
    AA
    aa1
    AB
    ab1
    a1
    

    expander

    the Function1 applied at each level of recursion to expand values into a Publisher, producing a graph.

    returns

    this Mono expanded depth-first to a Flux

  45. final def expandDeep(expander: (T) ⇒ Publisher[_ <: T], capacityHint: Int): Flux[T]

    Permalink

    Recursively expand elements into a graph and emit all the resulting element, in a depth-first traversal order.

    Recursively expand elements into a graph and emit all the resulting element, in a depth-first traversal order.

    That is: emit the value from this Mono, expand it and emit the first value at this first level of recursion, and so on... When no more recursion is possible, backtrack to the previous level and re-apply the strategy.

    For example, given the hierarchical structure

    A
      - AA
        - aa1
      - AB
        - ab1
      - a1
    

    Expands Mono.just(A) into

    A
    AA
    aa1
    AB
    ab1
    a1
    

    expander

    the Function1 applied at each level of recursion to expand values into a Publisher, producing a graph.

    capacityHint

    a capacity hint to prepare the inner queues to accommodate n elements per level of recursion.

    returns

    this Mono expanded depth-first to a Flux

  46. 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

  47. 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

  48. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  49. final def flatMap[R](transformer: (T) ⇒ Mono[R]): Mono[R]

    Permalink

    Transform the item emitted by this Mono asynchronously, returning the value emitted by another Mono (possibly changing the value type).

    Transform the item emitted by this Mono asynchronously, returning the value emitted by another Mono (possibly changing the value type).

    R

    the result type bound

    transformer

    the function to dynamically bind a new Mono

    returns

    a new Mono with an asynchronously mapped value.

  50. 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

  51. final def flatMapMany[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

  52. final def flatMapMany[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

  53. 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

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

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

    Permalink

    Handle the items emitted by this Mono by calling a biconsumer with the output sink for each onNext.

    Handle the items emitted by this Mono by calling a biconsumer with the output sink for each onNext. At most one SynchronousSink.next call must be performed and/or 0 or 1 SynchronousSink.error or SynchronousSink.complete.

    R

    the transformed type

    handler

    the handling BiConsumer

    returns

    a transformed Mono

  56. final def hasElement: Mono[Boolean]

    Permalink

    Emit a single boolean true if this Mono has an element.

    Emit a single boolean true if this Mono has an element.

    returns

    a new Mono with true if a value is emitted and false otherwise

  57. def hashCode(): Int

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

    Permalink

    Hides the identity of this Mono instance.

    Hides the identity of this Mono instance.

    The main purpose of this operator is to prevent certain identity-based optimizations from happening, mostly for diagnostic purposes.

    returns

    a new Mono instance

  59. final def ignoreElement: Mono[T]

    Permalink

    Ignores onNext signal (dropping it) and only reacts on termination.

    Ignores onNext signal (dropping it) and only reacts on termination.

    returns

    a new completable Mono.

  60. final def isInstanceOf[T0]: Boolean

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

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

    Permalink

    Observe Reactive Streams signals matching the passed filter options and use reactor.util.Logger support to handle trace implementation.

    Observe Reactive Streams signals matching the passed filter options and use reactor.util.Logger support to handle trace implementation. Default will use the passed Level and java.util.logging. If SLF4J is available, it will be used instead.

    Options allow fine grained filtering of the traced signal, for instance to only capture onNext and onError:

        mono.log("category", Level.INFO, SignalType.ON_NEXT, SignalType.ON_ERROR)
    
    
    
    
    
    
    
    
    @param category to be mapped into logger configuration (e.g. org.springframework
                    .reactor). If category ends with "." like "reactor.", a generated operator
                    suffix will complete, e.g. "reactor.Mono.Map".
    @param level    the [[Level]] to enforce for this tracing Mono (only FINEST, FINE,
                                INFO, WARNING and SEVERE are taken into account)
    @param showOperatorLine capture the current stack to display operator
                            class/line number.
    @param options          a vararg [[SignalType]] option to filter log messages
    @return a new unaltered [[Mono]]
    

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

    Permalink

    Observe Reactive Streams signals matching the passed flags options and use reactor.util.Logger support to handle trace implementation.

    Observe Reactive Streams signals matching the passed flags options and use reactor.util.Logger support to handle trace implementation. Default will use the passed Level and java.util.logging. If SLF4J is available, it will be used instead.

    Options allow fine grained filtering of the traced signal, for instance to only capture onNext and onError:

        mono.log("category", SignalType.ON_NEXT, SignalType.ON_ERROR)
    
    
    
    
    
    
    
    
    @param category to be mapped into logger configuration (e.g. org.springframework
                    .reactor). If category ends with "." like "reactor.", a generated operator
                    suffix will complete, e.g. "reactor.Flux.Map".
    @param level    the { @link Level} to enforce for this tracing Mono (only FINEST, FINE,
                                INFO, WARNING and SEVERE are taken into account)
    @param options a vararg [[SignalType]] option to filter log messages
    @return a new [[Mono]]
    
    

  64. final def log(category: Option[String]): Mono[T]

    Permalink

    Observe all Reactive Streams signals and use reactor.util.Logger support to handle trace implementation.

    Observe all Reactive Streams signals and use reactor.util.Logger support to handle trace implementation. Default will use Level.INFO and java.util.logging. If SLF4J is available, it will be used instead.

    category

    to be mapped into logger configuration (e.g. org.springframework .reactor). If category ends with "." like "reactor.", a generated operator suffix will complete, e.g. "reactor.Flux.Map".

    returns

    a new Mono

  65. final def log: Mono[T]

    Permalink

    Observe all Reactive Streams signals and trace them using reactor.util.Logger support.

    Observe all Reactive Streams signals and trace them using reactor.util.Logger support. Default will use Level.INFO and java.util.logging. If SLF4J is available, it will be used instead.

    The default log category will be "reactor.Mono", followed by a suffix generated from the source operator, e.g. "reactor.Mono.Map".

    returns

    a new Mono that logs signals

    See also

    Flux.log()

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

    Permalink

    Transform the item emitted by this Mono by applying a synchronous function to it.

    Transform the item emitted by this Mono by applying a synchronous function to it.

    R

    the transformed type

    mapper

    the synchronous transforming Function1

    returns

    a new Mono

    Definition Classes
    MonoMapablePublisher
  67. final def materialize(): Mono[Signal[T]]

    Permalink

    Transform the incoming onNext, onError and onComplete signals into Signal.

    Transform the incoming onNext, onError and onComplete signals into Signal. Since the error is materialized as a Signal, the propagation will be stopped and onComplete will be emitted. Complete signal will first emit a Signal.complete() and then effectively complete the flux.

    returns

    a Mono of materialized Signal

  68. 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

  69. final def name(name: String): Mono[T]

    Permalink

    Give a name to this sequence, which can be retrieved using reactor.core.scala.Scannable.name() as long as this is the first reachable reactor.core.scala.Scannable.parents().

    Give a name to this sequence, which can be retrieved using reactor.core.scala.Scannable.name() as long as this is the first reachable reactor.core.scala.Scannable.parents().

    name

    a name for the sequence

    returns

    the same sequence, but bearing a name

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

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

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

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

    Permalink

    Evaluate the accepted value against the given Class type.

    Evaluate the accepted value against the given Class type. If the predicate test succeeds, the value is passed into the new Mono. If the predicate test fails, the value is ignored.

    clazz

    the Class type to test values against

    returns

    a new Mono reduced to items converted to the matched type

  74. final def onErrorMap(predicate: (Throwable) ⇒ Boolean, mapper: (Throwable) ⇒ Throwable): Mono[T]

    Permalink

    Transform the error emitted by this Mono by applying a function if the error matches the given predicate, otherwise let the error flow.

    Transform the error emitted by this Mono by applying a function if the error matches the given predicate, otherwise let the error flow.

    predicate

    the error predicate

    mapper

    the error transforming Function1

    returns

    a transformed Mono

  75. final def onErrorMap[E <: Throwable](type: Class[E], mapper: (E) ⇒ Throwable): Mono[T]

    Permalink

    Transform the error emitted by this Mono by applying a function if the error matches the given type, otherwise let the error flow.

    Transform the error emitted by this Mono by applying a function if the error matches the given type, otherwise let the error flow.

    <img class="marble" src="https://raw.githubusercontent.com/reactor/reactor-core/v3.1.0.RC1/src/docs/marble/maperror.png"

    E

    the error type

    type

    the type to match

    mapper

    the error transforming Function1

    returns

    a transformed Mono

  76. final def onErrorMap(mapper: (Throwable) ⇒ Throwable): Mono[T]

    Permalink

    Transform the error emitted by this Mono by applying a function.

    Transform the error emitted by this Mono by applying a function.

    <img class="marble" src="https://raw.githubusercontent.com/reactor/reactor-core/v3.1.0.RC1/src/docs/marble/maperror.png"

    mapper

    the error transforming Function1

    returns

    a transformed Mono

  77. final def onErrorResume(predicate: (Throwable) ⇒ Boolean, fallback: (Throwable) ⇒ Mono[_ <: T]): Mono[T]

    Permalink

    Subscribe to a returned fallback publisher when an error matching the given predicate occurs.

    Subscribe to a returned fallback publisher when an error matching the given predicate occurs.

    alt="">

    predicate

    the error predicate to match

    fallback

    the Function1 mapping the error to a new Mono sequence

    returns

    a new Mono

    See also

    Flux#onErrorResume

  78. final def onErrorResume[E <: Throwable](type: Class[E], fallback: (E) ⇒ Mono[_ <: T]): Mono[T]

    Permalink

    Subscribe to a returned fallback publisher when an error matching the given type occurs.

    Subscribe to a returned fallback publisher when an error matching the given type occurs.

    alt="">

    E

    the error type

    type

    the error type to match

    fallback

    the Function1 mapping the error to a new Mono sequence

    returns

    a new Mono

    See also

    Flux.onErrorResume

  79. final def onErrorResume(fallback: (Throwable) ⇒ Mono[_ <: T]): Mono[T]

    Permalink

    Subscribe to a returned fallback publisher when any error occurs.

    Subscribe to a returned fallback publisher when any error occurs.

    fallback

    the function to map an alternative { @link Mono}

    returns

    an alternating Mono on source onError

    See also

    Flux.onErrorResume

  80. final def onErrorReturn(predicate: (Throwable) ⇒ Boolean, fallbackValue: T): Mono[T]

    Permalink

    Simply emit a captured fallback value when an error matching the given predicate is observed on this Mono.

    Simply emit a captured fallback value when an error matching the given predicate is observed on this Mono.

    predicate

    the error predicate to match

    fallbackValue

    the value to emit if a matching error occurs

    returns

    a new Mono

    Definition Classes
    MonoOnErrorReturn
  81. final def onErrorReturn[E <: Throwable](type: Class[E], fallbackValue: T): Mono[T]

    Permalink

    Simply emit a captured fallback value when an error of the specified type is observed on this Mono.

    Simply emit a captured fallback value when an error of the specified type is observed on this Mono.

    E

    the error type

    type

    the error type to match

    fallbackValue

    the value to emit if a matching error occurs

    returns

    a new falling back Mono

    Definition Classes
    MonoOnErrorReturn
  82. final def onErrorReturn(fallback: T): Mono[T]

    Permalink

    Simply emit a captured fallback value when any error is observed on this Mono.

    Simply emit a captured fallback value when any error is observed on this Mono.

    fallback

    the value to emit if an error occurs

    returns

    a new falling back Mono

    Definition Classes
    MonoOnErrorReturn
  83. final def onTerminateDetach(): Mono[T]

    Permalink

    Detaches the both the child Subscriber and the Subscription on termination or cancellation.

    Detaches the both the child Subscriber and the Subscription on termination or cancellation.

    This should help with odd retention scenarios when running with non-reactor Subscriber.

    returns

    a detachable Mono

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

    Permalink

    Emit the any of the result from this mono or from the given mono

    Emit the any of the result from this mono or from the given mono

    other

    the racing other { @link Mono} to compete with for the result

    returns

    a new Mono

    See also

    Mono.first

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

    Permalink

    Shares a Mono for the duration of a function that may transform it and consume it as many times as necessary without causing multiple subscriptions to the upstream.

    Shares a Mono for the duration of a function that may transform it and consume it as many times as necessary without causing multiple subscriptions to the upstream.

    R

    the output value type

    transform

    the tranformation function

    returns

    a new Mono

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

    Permalink

    Run onNext, onComplete and onError on a supplied Scheduler

    Run onNext, onComplete and onError on a supplied Scheduler

    Typically used for fast publisher, slow consumer(s) scenarios.

    mono.publishOn(Schedulers.single()).subscribe()

    scheduler

    a checked { @link reactor.core.scheduler.Scheduler.Worker} factory

    returns

    an asynchronously producing Mono

  87. 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

  88. 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

  89. 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

  90. 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

  91. 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

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

    Permalink

    Repeatedly subscribe to this Mono until there is an onNext signal when a companion sequence signals a number of emitted elements.

    Repeatedly subscribe to this Mono until there is an onNext signal when a companion sequence signals a number of emitted elements.

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

    Emits an IllegalStateException if the max repeat is exceeded and different from Int.MaxValue.

    maxRepeat

    the maximum repeat number of time (infinite if Int.MaxValue)

    repeatFactory

    the Function1 providing a Flux signalling the current repeat index from 0 on onComplete and returning a { @link Publisher} companion.

    returns

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

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

    Permalink

    Repeatedly subscribe to this Mono until there is an onNext signal when a companion sequence signals a number of emitted elements.

    Repeatedly subscribe to this Mono until there is an onNext signal when a companion sequence signals a number of emitted elements.

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

    repeatFactory

    the Function1 providing a Flux signalling the current number of repeat on onComplete and returning a Publisher companion.

    returns

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

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

    Permalink

    Re-subscribes to this Mono sequence up to the specified number of retries if it signals any error and the given Predicate matches otherwise push the error downstream.

    Re-subscribes to this Mono sequence up to the specified number of retries if it signals any error and the given Predicate matches otherwise push the error downstream.

    numRetries

    the number of times to tolerate an error

    retryMatcher

    the predicate to evaluate if retry should occur based on a given error signal

    returns

    a re-subscribing Mono on onError up to the specified number of retries and if the predicate matches.

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

    Permalink

    Re-subscribes to this Mono sequence if it signals any error and the given Predicate matches otherwise push the error downstream.

    Re-subscribes to this Mono sequence if it signals any error and the given Predicate matches otherwise push the error downstream.

    retryMatcher

    the predicate to evaluate if retry should occur based on a given error signal

    returns

    a re-subscribing Mono on onError if the predicates matches.

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

    Permalink

    Re-subscribes to this Mono sequence if it signals any error either indefinitely or a fixed number of times.

    Re-subscribes to this Mono sequence if it signals any error either indefinitely or a fixed number of times.

    The times == Long.MAX_VALUE is treated as infinite retry.

    numRetries

    the number of times to tolerate an error

    returns

    a re-subscribing Mono on onError up to the specified number of retries.

  97. final def retry(): Mono[T]

    Permalink

    Re-subscribes to this Mono sequence if it signals any error either indefinitely.

    Re-subscribes to this Mono sequence if it signals any error either indefinitely.

    The times == Long.MAX_VALUE is treated as infinite retry.

    returns

    a re-subscribing Mono on onError

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

    Permalink

    Retries this Mono when a companion sequence signals an item in response to this Mono error signal

    Retries this Mono when a companion sequence signals an item in response to this Mono error signal

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

    whenFactory

    the Function1 providing a Flux signalling any error from the source sequence and returning a Publisher companion.

    returns

    a re-subscribing Mono on onError when the companion Publisher produces an onNext signal

  99. final def subscribe(consumer: (T) ⇒ Unit, errorConsumer: (Throwable) ⇒ Unit, completeConsumer: ⇒ Unit, subscriptionConsumer: (Subscription) ⇒ 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 value

    errorConsumer

    the consumer to invoke on error signal

    completeConsumer

    the consumer to invoke on complete signal

    subscriptionConsumer

    the consumer to invoke on subscribe signal, to be used for the initial request, or null for max request

    returns

    a new Disposable to dispose the Subscription

  100. final def subscribe(consumer: (T) ⇒ Unit, errorConsumer: (Throwable) ⇒ Unit, completeConsumer: ⇒ 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 value

    errorConsumer

    the consumer to invoke on error signal

    completeConsumer

    the consumer to invoke on complete signal

    returns

    a new Disposable to dispose the Subscription

  101. 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

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

    Permalink

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

    Subscribe a 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 value

    returns

    a new Runnable to dispose the Subscription

  103. final def subscribe(): Disposable

    Permalink

    Subscribe to this Mono and request unbounded demand.

    Subscribe to this Mono and request unbounded demand.

    This version doesn't specify any consumption behavior for the events from the chain, especially no error handling, so other variants should usually be preferred.

    returns

    a new Disposable that can be used to cancel the underlying Subscription

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

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

    Permalink

    Run the requests to this Publisher Mono on a given worker assigned by the supplied Scheduler.

    Run the requests to this Publisher Mono on a given worker assigned by the supplied Scheduler.

    mono.subscribeOn(Schedulers.parallel()).subscribe())

    scheduler

    a checked reactor.core.scheduler.Scheduler.Worker factory

    returns

    an asynchronously requesting Mono

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

    Permalink

    Subscribe the Mono with the givne Subscriber and return it.

    Subscribe the Mono with the givne Subscriber and return it.

    E

    the reified type of the Subscriber for chaining

    subscriber

    the Subscriber to subscribe

    returns

    the passed Subscriber after subscribing it to this { @link Mono}

  107. final def subscriberContext(doOnContext: (Context) ⇒ Context): Mono[T]

    Permalink

    Enrich a potentially empty downstream Context by applying a Function1 to it, producing a new Context that is propagated upstream.

    Enrich a potentially empty downstream Context by applying a Function1 to it, producing a new Context that is propagated upstream.

    The Context propagation happens once per subscription (not on each onNext): it is done during the subscribe(Subscriber) phase, which runs from the last operator of a chain towards the first.

    So this operator enriches a Context coming from under it in the chain (downstream, by default an empty one) and passes the new enriched Context to operators above it in the chain (upstream, by way of them using Flux#subscribe(Subscriber,Context)).

    doOnContext

    the function taking a previous Context state and returning a new one.

    returns

    a contextualized Mono

    See also

    Context

  108. final def subscriberContext(mergeContext: Context): Mono[T]

    Permalink

    Enrich a potentially empty downstream Context by adding all values from the given Context, producing a new Context that is propagated upstream.

    Enrich a potentially empty downstream Context by adding all values from the given Context, producing a new Context that is propagated upstream.

    The Context propagation happens once per subscription (not on each onNext): it is done during the subscribe(Subscriber) phase, which runs from the last operator of a chain towards the first.

    So this operator enriches a Context coming from under it in the chain (downstream, by default an empty one) and passes the new enriched Context to operators above it in the chain (upstream, by way of them using Flux.subscribe(Subscriber,Context)).

    mergeContext

    the Context to merge with a previous Context state, returning a new one.

    returns

    a contextualized Mono

    See also

    Context

  109. final def switchIfEmpty(alternate: Mono[_ <: T]): Mono[T]

    Permalink

    Provide an alternative Mono if this mono is completed without data

    Provide an alternative Mono if this mono is completed without data

    alternate

    the alternate mono if this mono is empty

    returns

    an alternating Mono on source onComplete without elements

    See also

    Flux.switchIfEmpty

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

    Permalink
    Definition Classes
    AnyRef
  111. final def tag(key: String, value: String): Mono[T]

    Permalink

    Tag this mono with a key/value pair.

    Tag this mono with a key/value pair. These can be retrieved as a Stream of all tags throughout the publisher chain by using reactor.core.scala.Scannable.tags() (as traversed by reactor.core.scala.Scannable.parents()).

    key

    a tag key

    value

    a tag value

    returns

    the same sequence, but bearing tags

  112. final def take(duration: Duration, timer: Scheduler): Mono[T]

    Permalink

    Give this Mono a chance to resolve within a specified time frame but complete if it doesn't.

    Give this Mono a chance to resolve within a specified time frame but complete if it doesn't. This works a bit like Mono.timeout(Duration) except that the resulting Mono completes rather than errors when the timer expires.

    The timeframe is evaluated using the provided Scheduler.

    duration

    the maximum duration to wait for the source Mono to resolve.

    timer

    the Scheduler on which to measure the duration.

    returns

    a new Mono that will propagate the signals from the source unless no signal is received for duration, in which case it completes.

  113. final def take(duration: Duration): Mono[T]

    Permalink

    Give this Mono a chance to resolve within a specified time frame but complete if it doesn't.

    Give this Mono a chance to resolve within a specified time frame but complete if it doesn't. This works a bit like Mono.timeout(Duration) except that the resulting Mono completes rather than errors when the timer expires.

    The timeframe is evaluated using the parallel Scheduler.

    duration

    the maximum duration to wait for the source Mono to resolve.

    returns

    a new Mono that will propagate the signals from the source unless no signal is received for duration, in which case it completes.

  114. final def takeUntilOther(other: Publisher[_]): Mono[T]

    Permalink

    Give this Mono a chance to resolve before a companion Publisher emits.

    Give this Mono a chance to resolve before a companion Publisher emits. If the companion emits before any signal from the source, the resulting Mono will complete. Otherwise, it will relay signals from the source.

    other

    a companion Publisher that short-circuits the source with an onComplete signal if it emits before the source emits.

    returns

    a new Mono that will propagate the signals from the source unless a signal is first received from the companion Publisher, in which case it completes.

  115. final def then[V](other: Mono[V]): Mono[V]

    Permalink

    Ignore element from this Mono and transform its completion signal into the emission and completion signal of a provided Mono[V].

    Ignore element from this Mono and transform its completion signal into the emission and completion signal of a provided Mono[V]. Error signal is replayed in the resulting Mono[V].

    V

    the element type of the supplied Mono

    other

    a Mono to emit from after termination

    returns

    a new Mono that emits from the supplied Mono

  116. final def then(): Mono[Unit]

    Permalink

    Return a Mono[Unit] which only replays complete and error signals from this Mono.

    Return a Mono[Unit] which only replays complete and error signals from this Mono.

    returns

    a Mono igoring its payload (actively dropping)

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

    Permalink

    Return a Mono[Unit] that waits for this Mono to complete then for a supplied Publisher[Unit] to also complete.

    Return a Mono[Unit] that waits for this Mono to complete then for a supplied Publisher[Unit] to also complete. The second completion signal is replayed, or any error signal that occurs instead.

    other

    a Publisher to wait for after this Mono's termination

    returns

    a new Mono completing when both publishers have completed in sequence

  118. 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.

  119. 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

  120. 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

  121. 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

  122. 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

  123. 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

  124. 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}

  125. 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

  126. 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

  127. 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

  128. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  129. 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

  130. final def wait(): Unit

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

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

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

Inherited from OnErrorReturn[T]

Inherited from MapablePublisher[T]

Inherited from Publisher[T]

Inherited from AnyRef

Inherited from Any

Ungrouped