Interface ResponseBody.Sse<A,B extends ResponseBody.Sse.Event<A>,C extends ResponseBody.Sse.EventFactory<A,B>>

Type Parameters:
A - the type of data sent in the event
B - the server-sent event type
C - the server-sent event factory
All Known Subinterfaces:
WebResponseBody.SseEncoder<A>
Enclosing interface:
ResponseBody

public static interface ResponseBody.Sse<A,B extends ResponseBody.Sse.Event<A>,C extends ResponseBody.Sse.EventFactory<A,B>>

A server-sent events payload producer as defined by Server-Sent Events.

Since:
1.0
Author:
Jeremy Kuhn
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Represents a server-sent event.
    static interface 
    A server-sent event factory is used to create server-sent events.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sets the server-sent events stream in the specified consumer using the server-sent event factory to create events and the server-sent events producer to sets the stream of events.
  • Method Details

    • from

      void from(BiConsumer<C,OutboundData<B>> data)

      Sets the server-sent events stream in the specified consumer using the server-sent event factory to create events and the server-sent events producer to sets the stream of events.

      Parameters:
      data - a function in which server-sent events stream must be set