Observer

trait Observer[-A] extends Serializable

The Observer from the Rx pattern is the trio of callbacks that get subscribed to an Observable for receiving events.

The events received must follow the Rx grammar, which is: onNext * (onComplete | onError)?

That means an Observer can receive zero or multiple events, the stream ending either in one or zero onComplete or onError (just one, not both), and after onComplete or onError, a well behaved Observable implementation shouldn't send any more onNext events.

Companion:
object
trait Serializable
class Any
trait Sync[A]
trait Sync[A]
class ConcurrentSubject[I, O]
trait Subscriber[A]
class Subject[I, O]
class AsyncSubject[A]
class ReplaySubject[A]

Value members

Abstract methods

def onNext(elem: A): Future[Ack]

Concrete methods

def contramap[B](f: B => A): Observer[B]
Implicitly added by Extensions

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 feed(iterable: Iterable[A])(implicit s: Scheduler): Future[Ack]
Implicitly added by Extensions

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

def feed(subscription: BooleanCancelable, iterable: Iterable[A])(implicit s: Scheduler): Future[Ack]
Implicitly added by Extensions

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

def feed(iterator: Iterator[A])(implicit s: Scheduler): Future[Ack]
Implicitly added by Extensions

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:
iterator

is the collection of items to push downstream

def feed(subscription: BooleanCancelable, iterator: Iterator[A])(implicit s: Scheduler): Future[Ack]
Implicitly added by Extensions

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:
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

def onNextAll(xs: Iterable[A])(implicit s: Scheduler): Future[Ack]
Implicitly added by Extensions

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:
xs

the traversable object containing the elements to feed into our observer.

def toReactive(implicit s: Scheduler): Subscriber[A]
Implicitly added by Extensions

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 toReactive(requestCount: Int)(implicit s: Scheduler): Subscriber[A]
Implicitly added by Extensions

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

Concrete fields

Implicitly added by Extensions