(close-sse {:keys [:stream]})
Close manifold stream if any.
Close manifold stream if any.
New line followed by whitespace chars ending with new line.
New line followed by whitespace chars ending with new line.
Empty line not followed by another empty line. This regex uses negative lookahead and DOTALL mode.
Empty line not followed by another empty line. This regex uses negative lookahead and DOTALL mode.
(mapcat-with-accumulator f)
Returns transducer similar to mapcat but with accumulator. f accepts current val and accumulator from previous call of f f returns coll and next val of accumulator
Returns transducer similar to mapcat but with accumulator. f accepts current val and accumulator from previous call of f f returns coll and next val of accumulator
(parse-body response)
Parse body from response
using content-type header to determine format.
If content-type is missing or unsupported, or parsing error occurs, throw ex with response in data. If body is not present, return nil. If body is successfully parsed, return map and full response in meta.
Parse body from `response` using content-type header to determine format. If content-type is missing or unsupported, or parsing error occurs, throw ex with response in data. If body is not present, return nil. If body is successfully parsed, return map and full response in meta.
(parse-sse event)
Parse JSON from event
if event is type of :data
Parse JSON from `event` if event is type of :data
(request req)
Invoke aleph.http/request
and transform manifold deferred to core.async channel.
Return new channel delivering response:
Invoke `aleph.http/request` and transform manifold deferred to core.async channel. Return new channel delivering response: * Ring response if ok * Exception if error occurs
Set pof retriable status codes based on https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
Set pof retriable status codes based on https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
(sse req pool-opts resp-chan)
Invoke [[aleph.http/request]] on SSE endpoint and stream response to core.async channel.
Uses pool defined in sse-pool
-> with 1 connection and raw-stream? option.
Pool could be customized with pool-opts
(see [[aleph.http/request]] documentation).
Server-sent events is a stream of text lines separated by empty lines.
Returns new channel delivering server-sent events with following types
| Type | Attributes | Description
| -----------| -----------|
| :connect
| :stream | Connection is established. Use :stream to close SSE.
| :data
| :id :data | One SSE event. When event contains multiple data attributes, they are concatenated with newline character.
| :retry
| :retry | SSE indicates to set retry-timeout.
| :close
| | Sent before stream and respective core.async channel is closed.
If SSE request could not be made, exception is written to the channel and channel is closed.
Invoke [[aleph.http/request]] on SSE endpoint and stream response to core.async channel. Uses pool defined in `sse-pool` -> with 1 connection and raw-stream? option. Pool could be customized with `pool-opts` (see [[aleph.http/request]] documentation). Server-sent events is a stream of text lines separated by empty lines. Returns new channel delivering server-sent events with following types | Type | Attributes | Description | -----------| -----------| | `:connect` | :stream | Connection is established. Use :stream to close SSE. | `:data` | :id :data | One SSE event. When event contains multiple data attributes, they are concatenated with newline character. | `:retry` | :retry | SSE indicates to set retry-timeout. | `:close` | | Sent before stream and respective core.async channel is closed. If SSE request could not be made, exception is written to the channel and channel is closed.
(sse-buffer->events buf prev-buf)
Converts sse buffer to collection of events and next buffer value
Converts sse buffer to collection of events and next buffer value
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close