SseStreamingEndpointImpl

open class SseStreamingEndpointImpl<TEntity : Any>(referrer: Endpoint, relativeUri: URI, entityType: Class<TEntity>, eventType: String? = null) : AbstractEndpoint, StreamingEndpoint<TEntity>

Endpoint for a stream of TEntitys using Server-Sent Events (SSE).

Sends Accept: text/event-stream. By default, transparently reconnects on connection drops or transient errors, honoring the server-supplied retry: interval and resuming via the Last-Event-ID header.

Parameters

referrer

The endpoint used to navigate to this one.

relativeUri

The URI of this endpoint relative to the referrer's.

entityType

The type of individual elements in the stream.

eventType

If set, only events with this event: type are emitted; others are ignored. null emits all events.

Type Parameters

TEntity

The type of individual elements in the stream.

Constructors

Link copied to clipboard
constructor(referrer: Endpoint, relativeUri: URI, entityType: Class<TEntity>, eventType: String? = null)
constructor(referrer: Endpoint, relativeUri: String, entityType: Class<TEntity>, eventType: String? = null)

Creates a new SSE streaming endpoint.

Properties

Link copied to clipboard

Whether to transparently reconnect on connection drops, transient transport errors and 5xx responses.

Link copied to clipboard

The reconnection interval used when the server has not (yet) supplied one via the SSE retry: field.

Link copied to clipboard
open override val errorHandler: ErrorHandler
Link copied to clipboard
open override val httpClient: OkHttpClient
Link copied to clipboard
open override val linkExtractor: LinkExtractor
Link copied to clipboard
open override val serializers: List<Serializer>
Link copied to clipboard
open override val uri: URI

Functions

Link copied to clipboard
fun <T> deserialize(body: ResponseBody, type: Class<T>): T?
Link copied to clipboard
fun <T> deserializeList(body: ResponseBody, type: Class<T>): List<T>?
Link copied to clipboard
open override fun getLinks(rel: String): List<Pair<URI, String?>>
Link copied to clipboard
fun getLinkTemplate(rel: String): com/damnhandy/uri/template/UriTemplate
Link copied to clipboard
open override fun getObservable(): Observable<TEntity>

Provides an Observable stream of entities.

Link copied to clipboard
open override fun link(rel: String): URI
Link copied to clipboard
open override fun linkTemplate(rel: String, variables: Map<String, Any>): URI
Link copied to clipboard
fun <T> serialize(entity: T, type: Class<T>): RequestBody
Link copied to clipboard
fun <T> serializeList(entities: Iterable<T>, type: Class<T>): RequestBody
Link copied to clipboard
fun setDefaultLink(rel: String, href: String?)
Link copied to clipboard