Object/Trait

reactor.core.scala.publisher

SMono

Related Docs: trait SMono | package publisher

Permalink

object SMono extends ScalaConverters

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SMono
  2. ScalaConverters
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit class PimpConnectableFlux[T] extends AnyRef

    Permalink
    Definition Classes
    ScalaConverters
  2. implicit class PimpJFlux[T] extends AnyRef

    Permalink
    Definition Classes
    ScalaConverters
  3. implicit class PimpJMono[T] extends AnyRef

    Permalink
    Definition Classes
    ScalaConverters

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. def apply[T](source: Publisher[_ <: T]): SMono[T]

    Permalink

    An alias of SMono.fromPublisher

    T

    a value type parameter of this SMono

    source

    The underlying Publisher. This can be used to convert JMono into SMono

    returns

    SMono

  5. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def create[T](callback: (MonoSink[T]) ⇒ Unit): SMono[T]

    Permalink

    Creates a deferred emitter that can be used with callback-based APIs to signal at most one value, a complete or an error signal.

    Creates a deferred emitter that can be used with callback-based APIs to signal at most one value, a complete or an error signal.

    Bridging legacy API involves mostly boilerplate code due to the lack of standard types and methods. There are two kinds of API surfaces: 1) addListener/removeListener and 2) callback-handler.

    1) addListener/removeListener pairs
    To work with such API one has to instantiate the listener, call the sink from the listener then register it with the source:

    
    SMono.<String>create(sink => {
    HttpListener listener = event => {
    if (event.getResponseCode() >= 400) {
                sink.error(new RuntimeException("Failed"));
    } else {
    String body = event.getBody();
    if (body.isEmpty()) {
                    sink.success();
    } else {
                    sink.success(body.toLowerCase());
    }
    }
    };
    
        client.addListener(listener);
    
        sink.onDispose(() => client.removeListener(listener));
    });
    
    
    Note that this works only with single-value emitting listeners. Otherwise, all subsequent signals are dropped. You may have to add client.removeListener(this); to the listener's body.

    2) callback handler
    This requires a similar instantiation pattern such as above, but usually the successful completion and error are separated into different methods. In addition, the legacy API may or may not support some cancellation mechanism.

    
    SMono.<String>create(sink => {
    Callback<String> callback = new Callback<String>() {
    @Override
    public void onResult(String data) {
                sink.success(data.toLowerCase());
    }
    
    @Override
    public void onError(Exception e) {
                sink.error(e);
    }
    }
    
    // without cancellation support:
    
        client.call("query", callback);
    
    // with cancellation support:
    
    AutoCloseable cancel = client.call("query", callback);
        sink.onDispose(() => {
    try {
                cancel.close();
    } catch (Exception ex) {
                Exceptions.onErrorDropped(ex);
    }
    });
    });
    
    

    T

    The type of the value emitted

    callback

    Consume the { @link MonoSink} provided per-subscriber by Reactor to generate signals.

    returns

    a SMono

  8. def defer[T](supplier: () ⇒ SMono[T]): SMono[T]

    Permalink
  9. def delay(duration: Duration, timer: Scheduler = Schedulers.parallel()): SMono[Long]

    Permalink
  10. def empty[T]: SMono[T]

    Permalink
  11. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def firstEmitter[T](monos: SMono[_ <: T]*): SMono[T]

    Permalink

    Pick the first result coming from any of the given monos and populate a new Mono.

    Pick the first result coming from any of the given monos and populate a new Mono.

    T

    The type of the function result.

    monos

    The deferred monos to use.

    returns

    a SMono.

  15. def fromCallable[T](supplier: Callable[T]): SMono[T]

    Permalink
  16. def fromDirect[I](source: Publisher[_ <: I]): SMono[I]

    Permalink
  17. def fromFuture[T](future: Future[T])(implicit executionContext: ExecutionContext): SMono[T]

    Permalink
  18. def fromPublisher[T](source: Publisher[_ <: T]): SMono[T]

    Permalink
  19. def fromTry[T](aTry: ⇒ Try[T]): SMono[T]

    Permalink

    Transform a Try into an SMono

    Transform a Try into an SMono

    T

    The type of the Try

    aTry

    a Try

    returns

    an SMono

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  22. def ignoreElements[T](source: Publisher[T]): SMono[T]

    Permalink
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def just[T](data: T): SMono[T]

    Permalink
  25. def justOrEmpty[T](data: T): SMono[T]

    Permalink
  26. def justOrEmpty[T](data: Option[_ <: T]): SMono[T]

    Permalink
  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. def never[T]: SMono[T]

    Permalink
  29. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  31. def raiseError[T](error: Throwable): SMono[T]

    Permalink
  32. def sequenceEqual[T](source1: Publisher[_ <: T], source2: Publisher[_ <: T], isEqual: (T, T) ⇒ Boolean = (t1: T, t2: T) => t1 == t2, bufferSize: Int = SMALL_BUFFER_SIZE): SMono[Boolean]

    Permalink
  33. def subscribeContext(): SMono[Context]

    Permalink

    Create a SMono emitting the Context available on subscribe.

    Create a SMono emitting the Context available on subscribe. If no Context is available, the mono will simply emit the empty Context.

    returns

    a new SMono emitting current context

    See also

    SMono.subscribe(CoreSubscriber)

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. def when(sources: Publisher[Unit] with MapablePublisher[Unit]*): SMono[Unit]

    Permalink

    Aggregate given publishers into a new Mono that will be fulfilled when all of the given sources have been fulfilled.

    Aggregate given publishers into a new Mono that will be fulfilled when all of the given sources have been fulfilled. An error will cause pending results to be cancelled and immediate error emission to the returned SMono.

    sources

    The sources to use.

    returns

    a SMono.

  40. def when(sources: Iterable[_ <: Publisher[Unit] with MapablePublisher[Unit]]): SMono[Unit]

    Permalink

    Aggregate given void publishers into a new a Mono that will be fulfilled when all of the given Monos have been fulfilled.

    Aggregate given void publishers into a new a Mono that will be fulfilled when all of the given Monos have been fulfilled. If any Mono terminates without value, the returned sequence will be terminated immediately and pending results cancelled.

    sources

    The sources to use.

    returns

    a SMono.

  41. def whenDelayError(sources: Iterable[_ <: Publisher[_] with MapablePublisher[_]]): SMono[Unit]

    Permalink

    Aggregate given publishers into a new SMono that will be fulfilled when all of the given sources have completed.

    Aggregate given publishers into a new SMono that will be fulfilled when all of the given sources have completed. If any Publisher terminates without value, the returned sequence will be terminated immediately and pending results cancelled. Errors from the sources are delayed. If several Publishers error, the exceptions are combined (as suppressed exceptions on a root exception).

    sources

    The sources to use.

    returns

    a SMono.

  42. def zip[R](monos: Iterable[_ <: SMono[_]], combinator: (Array[AnyRef]) ⇒ R): SMono[R]

    Permalink
  43. def zip[R](combinator: (Array[AnyRef]) ⇒ R, monos: SMono[_]*): SMono[R]

    Permalink
  44. def zipDelayError[R](combinator: (Array[Any]) ⇒ R, monos: SMono[_]*): SMono[R]

    Permalink
  45. def zipDelayError[R](monos: Iterable[_ <: SMono[_]], combinator: Function1[Array[AnyRef], _ <: R]): SMono[R]

    Permalink
  46. def zipDelayError[T1, T2, T3, T4, T5, T6](p1: SMono[_ <: T1], p2: SMono[_ <: T2], p3: SMono[_ <: T3], p4: SMono[_ <: T4], p5: SMono[_ <: T5], p6: SMono[_ <: T6]): SMono[(T1, T2, T3, T4, T5, T6)]

    Permalink
  47. def zipDelayError[T1, T2, T3, T4, T5](p1: SMono[_ <: T1], p2: SMono[_ <: T2], p3: SMono[_ <: T3], p4: SMono[_ <: T4], p5: SMono[_ <: T5]): SMono[(T1, T2, T3, T4, T5)]

    Permalink
  48. def zipDelayError[T1, T2, T3, T4](p1: SMono[_ <: T1], p2: SMono[_ <: T2], p3: SMono[_ <: T3], p4: SMono[_ <: T4]): SMono[(T1, T2, T3, T4)]

    Permalink
  49. def zipDelayError[T1, T2, T3](p1: SMono[_ <: T1], p2: SMono[_ <: T2], p3: SMono[_ <: T3]): SMono[(T1, T2, T3)]

    Permalink
  50. def zipDelayError[T1, T2](p1: SMono[_ <: T1], p2: SMono[_ <: T2]): SMono[(T1, T2)]

    Permalink

Inherited from ScalaConverters

Inherited from AnyRef

Inherited from Any

Ungrouped