Observer

object Observer
Companion:
class
class Object
trait Matchable
class Any

Type members

Classlikes

final implicit class Extensions[A](val target: Observer[A]) extends AnyVal

Extension methods for Observer.

Extension methods for Observer.

trait Sync[-A] extends Observer[A]

An Observer.Sync is an Observer that signals demand to upstream synchronously (i.e. the upstream observable doesn't need to wait on a Future in order to decide whether to send the next event or not).

An Observer.Sync is an Observer that signals demand to upstream synchronously (i.e. the upstream observable doesn't need to wait on a Future in order to decide whether to send the next event or not).

Can be used for optimizations.

Value members

Concrete methods

def contramap[A, B](fa: Observer[A])(f: B => A): Observer[B]

Given a contravariant mapping function, transform the source Observer by transforming the input.

Given a contravariant mapping function, transform the source Observer by transforming the input.

def dump[A](prefix: String, out: PrintStream): Sync[A]

Builds an Observer that just logs incoming events.

Builds an Observer that just logs incoming events.

def empty[A](implicit r: UncaughtExceptionReporter): Sync[A]

Helper for building an empty observer that doesn't do anything, besides logging errors in case they happen.

Helper for building an empty observer that doesn't do anything, besides logging errors in case they happen.

def feed[A](target: Observer[A], iterable: Iterable[A])(implicit s: Scheduler): Future[Ack]

Feeds the Observer instance with elements from the given collection, respecting the contract and returning a Future[Ack] with the last acknowledgement given after the last emitted element.

Feeds the Observer instance with elements from the given collection, respecting the contract and returning a Future[Ack] with the last acknowledgement given after the last emitted element.

Value parameters:
iterable

is the collection of items to push downstream

target

is the observer that will get the events

def feed[A](target: Observer[A], subscription: BooleanCancelable, iterable: Iterable[A])(implicit s: Scheduler): Future[Ack]

Feeds the Observer instance with elements from the given collection, respecting the contract and returning a Future[Ack] with the last acknowledgement given after the last emitted element.

Feeds the Observer instance with elements from the given collection, respecting the contract and returning a Future[Ack] with the last acknowledgement given after the last emitted element.

Value parameters:
iterable

is the collection of items to push downstream

subscription

is a BooleanCancelable that will be queried for its cancellation status, but only on asynchronous boundaries, and when it is seen as being isCanceled, streaming is stopped

target

is the observer that will get the events

def feed[A](target: Observer[A], iterator: Iterator[A])(implicit s: Scheduler): Future[Ack]

Feeds the Observer instance with elements from the given Iterator, respecting the contract and returning a Future[Ack] with the last acknowledgement given after the last emitted element.

Feeds the Observer instance with elements from the given Iterator, respecting the contract and returning a Future[Ack] with the last acknowledgement given after the last emitted element.

Value parameters:
iterator

is the collection of items to push downstream

target

is the observer that will get the events

def feed[A](target: Observer[A], subscription: BooleanCancelable, iterator: Iterator[A])(implicit s: Scheduler): Future[Ack]

Feeds the Observer instance with elements from the given Iterator, respecting the contract and returning a Future[Ack] with the last acknowledgement given after the last emitted element.

Feeds the Observer instance with elements from the given Iterator, respecting the contract and returning a Future[Ack] with the last acknowledgement given after the last emitted element.

Value parameters:
iterator

is the collection of items to push downstream

subscription

is a BooleanCancelable that will be queried for its cancellation status, but only on asynchronous boundaries, and when it is seen as being isCanceled, streaming is stopped

target

is the observer that will get the events

def fromReactiveSubscriber[A](subscriber: Subscriber[A], subscription: Cancelable)(implicit s: Scheduler): Observer[A]

Given an org.reactivestreams.Subscriber as defined by the Reactive Streams specification, it builds an Observer instance compliant with the Monix Rx implementation.

Given an org.reactivestreams.Subscriber as defined by the Reactive Streams specification, it builds an Observer instance compliant with the Monix Rx implementation.

def stopped[A]: Sync[A]

Helper for building an empty observer that continuously returns Stop in onNext and that reports errors pushed with onError.

Helper for building an empty observer that continuously returns Stop in onNext and that reports errors pushed with onError.

def toReactiveSubscriber[A](observer: Observer[A])(implicit s: Scheduler): Subscriber[A]

Transforms the source Observer into a org.reactivestreams.Subscriber instance as defined by the Reactive Streams specification.

Transforms the source Observer into a org.reactivestreams.Subscriber instance as defined by the Reactive Streams specification.

def toReactiveSubscriber[A](observer: Observer[A], requestCount: Int)(implicit s: Scheduler): Subscriber[A]

Transforms the source Observer into a org.reactivestreams.Subscriber instance as defined by the Reactive Streams specification.

Transforms the source Observer into a org.reactivestreams.Subscriber instance as defined by the Reactive Streams specification.

Value parameters:
requestCount

a strictly positive number, representing the size of the buffer used and the number of elements requested on each cycle when communicating demand, compliant with the reactive streams specification

Implicits

Implicits

final implicit def Extensions[A](target: Observer[A]): Extensions[A]

Extension methods for Observer.

Extension methods for Observer.