Interface EventStreamResponseHandler.Builder<ResponseT,​EventT,​SubBuilderT>

    • Method Detail

      • onResponse

        SubBuilderT onResponse​(Consumer<ResponseT> responseConsumer)
        Callback to invoke when the initial response is received.
        Parameters:
        responseConsumer - Callback that will process the initial response.
        Returns:
        This builder for method chaining.
      • onError

        SubBuilderT onError​(Consumer<Throwable> consumer)
        Callback to invoke in the event on an error.
        Parameters:
        consumer - Callback that will process any error that occurs.
        Returns:
        This builder for method chaining.
      • onComplete

        SubBuilderT onComplete​(Runnable runnable)
        Action to invoke when the event stream completes. This will only be invoked when all events are being received.
        Parameters:
        runnable - Action to run on the completion of the event stream.
        Returns:
        This builder for method chaining.
      • subscriber

        SubBuilderT subscriber​(Supplier<org.reactivestreams.Subscriber<EventT>> eventSubscriberSupplier)
        Subscriber that will subscribe to the SdkPublisher of events. Subscriber must be provided.
        Parameters:
        eventSubscriberSupplier - Supplier for a subscriber that will be subscribed to the publisher of events.
        Returns:
        This builder for method chaining.
      • subscriber

        SubBuilderT subscriber​(Consumer<EventT> eventConsumer)
        Sets the subscriber to the SdkPublisher of events. The given consumer will be called for each event received by the publisher. Events are requested sequentially after each event is processed. If you need more control over the backpressure strategy consider using subscriber(Supplier) instead.
        Parameters:
        eventConsumer - Consumer that will process incoming events.
        Returns:
        This builder for method chaining.