← all modules
Sky.Core.Http.Stream
Sky.Core.Http.Stream
Sky.Core.Http.Stream — incremental HTTP response bodies as Subs.
Types
type StreamId = StreamId Int
type ChunkEvent = Chunk String | Done | Errored Error
Values
chunks : StreamId -> (ChunkEvent -> msg) -> Sub msg
`chunks sid toMsg` — subscribe to the chunk stream for `sid`.
close : StreamId -> Task Error ()
`close sid` — release the underlying connection. Idempotent —
forEachChunk : StreamId -> (String -> Task Error ()) -> Task Error ()
`forEachChunk sid body` — block the calling goroutine until the
open : HttpRequest -> Task Error StreamId
`open req` — start streaming the response body of `req`. The