- All Implemented Interfaces:
- com.ning.http.client.BodyGenerator
public class ObservableBodyGenerator
extends java.lang.Object
implements com.ning.http.client.BodyGenerator
A BodyGenerator that subscribes to an Observable and creates a com.ning.http.client.Body from it.
You can specify the capacity of the underlying blocking queue.
By default the subscription happens from the code that calls the getBody() method.
This can lead to deadlocks with respect to the queueCapacity, because when the queue is full the onNext call will block.
To avoid this call subscribeOn before passing in the Observable with a Scheduler specific for your use case, f.e. Schedulers.io()
Otherwise this is fully back-pressured.