prepareObserver

protected StreamObserver<Ack> prepareObserver(Iterable<T> messages, StreamObserver<Ack> source)

Prepares the given StreamObserver to post messages into this bus.

This method is an extension point of a Bus.

When posting messages into the bus, the message acknowledgements are passed to the observer created by this method.

Conventionally, the resulting StreamObserver should delegate calls to the source observer, so that the caller receives the posting outcome. If violating this convention, the Bus implementation should specify the altered behavior explicitly.

The messages can be used to construct the observer. The resulting observer is used only for acknowledgment of the given messages.

By default, this method returns the source observer. See Bus subclasses for the altered behavior specification.

Return

a transformed observer of Ack streams

Parameters

messages

the messages to create an observer for

source

the source StreamObserver to be transformed