Liking cljdoc? Tell your friends :D

clj-sse-client.sse


connectclj

(connect connection)
(connect connection sse-options)

Initiated a SSE connection. Optionally takes SSE options which override the existing options. This allows referring to the connection object in the callbacks.

Initiated a SSE connection.
Optionally takes SSE options which override the existing options.
This allows referring to the connection object in the callbacks.
sourceraw docstring

default-connection-optionsclj

source

delayed-executorclj

(delayed-executor executor delay)
source

IConnectioncljprotocol

-connectclj

(-connect this)
(-connect this subscription)

-reconnectclj

(-reconnect this)
source

ISubscribercljprotocol

A protocol for accessing a subscription from an underlying object.

A protocol for accessing a subscription from an underlying object.

-subscriptionclj

(-subscription subscriber)
sourceraw docstring

reconnect-callbackclj

(reconnect-callback connection attempts max-reconnection-attemps)
source

sse-connectionclj

(sse-connection client connection-request subscription options)

Takes HttpClient, connection request subscription specification and connection options. Returns a [[SSEConnection]] which can connect, close and reconnect.

Takes HttpClient, connection request subscription specification and connection options.
Returns a [[SSEConnection]] which can connect, close and reconnect.
sourceraw docstring

sse-flow-subscriberclj

(sse-flow-subscriber
  {:keys [on-complete on-error on-next on-subscribe]
   :or {on-complete noop on-error noop on-next identity on-subscribe noop}})

Create a [[SSEFlowSubscriber]] with callbacks similar to a [[Flow$Subscriber]] with slight differences:

on-complete: called when the flow completes with an internal state. on-subscribe: called on subscription with an internal state. on-next: Unlike a [[Flow$Subscriber]], called when an SSE event is emitted from the buffer with the event as an argument. on-next SHOULD return a truth-y value. A false-y value will cause events to stop being consumed. on-error: Called with the internal state and a Throwable.

The returned subscriber also implements ISubscriber, exposing its internal [[Flow$Subscription]], and [[ISSE]] which defines how the next SSE event must be handled.

Create a [[SSEFlowSubscriber]] with callbacks similar to
a [[Flow$Subscriber]] with slight differences:

`on-complete`: called when the flow completes with an internal state.
`on-subscribe`: called on subscription with an internal state.
`on-next`: Unlike a [[Flow$Subscriber]], called when an SSE event is
emitted from the buffer with the event as an argument.
`on-next` SHOULD return a truth-y value. A false-y value will cause
events to stop being consumed.
`on-error`: Called with the internal state and a Throwable.

The returned subscriber also implements [[ISubscriber]], exposing
its internal [[Flow$Subscription]], and [[ISSE]] which defines how the
next SSE event must be handled.
sourceraw docstring

sse-subscriptionclj

(sse-subscription client request opts)

Initialize a SSE subscription with client according to request and opts. opts are passed to sse-flow-subscriber. Returns a tuple of [CompletableFuture<Response> ISubscriber]. It's worth considering the future won't be completed until the end of the response. If the subscription is expected to go on for a while, don't block a thread waiting for completion.

Initialize a SSE subscription with `client` according to `request` and `opts`.
`opts` are passed to [[sse-flow-subscriber]].
Returns a tuple of [CompletableFuture<Response> [[ISubscriber]]].
It's worth considering the future won't be completed until the end of
the response. If the subscription is expected to go on for a while,
don't block a thread waiting for completion.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close