Module io.inverno.mod.http.server
Package io.inverno.mod.http.server
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 eventB
- the server-sent event typeC
- 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
Modifier and TypeInterfaceDescriptionstatic interface
Represents a server-sent event.static interface
ResponseBody.Sse.EventFactory<A,
B extends ResponseBody.Sse.Event<A>> A server-sent event factory is used to create server-sent events. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Method Details
-
from
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
-