Class FlowableBodyGenerator

  • All Implemented Interfaces:
    org.asynchttpclient.request.body.generator.BodyGenerator

    public class FlowableBodyGenerator
    extends java.lang.Object
    implements org.asynchttpclient.request.body.generator.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.
    • Constructor Summary

      Constructors 
      Constructor Description
      FlowableBodyGenerator​(io.reactivex.rxjava3.core.Flowable<byte[]> observable)  
      FlowableBodyGenerator​(io.reactivex.rxjava3.core.Flowable<byte[]> observable, int queueCapacity)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.asynchttpclient.request.body.Body createBody()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FlowableBodyGenerator

        public FlowableBodyGenerator​(io.reactivex.rxjava3.core.Flowable<byte[]> observable)
      • FlowableBodyGenerator

        public FlowableBodyGenerator​(io.reactivex.rxjava3.core.Flowable<byte[]> observable,
                                     int queueCapacity)
    • Method Detail

      • createBody

        public org.asynchttpclient.request.body.Body createBody()
        Specified by:
        createBody in interface org.asynchttpclient.request.body.generator.BodyGenerator