def read.chunk
gralha-http-server@0.1.0.0 · server.bend:10
import gralha-http-server@0.1.0.0/server.bend as Server
import Base
import gralha-http-core@0.1.0.0/http.bend as Http
10def read.chunk(socket: Socket, +text: String, +max: U32, next: Socket -> String -> IO(Socket & String)) ->
11 IO(Socket & String):
12 Http.when(Socket -> IO(Socket & String), Http.request.complete(text) || U32.is_gt(Http.utf8.length(text), max),
13 _ => s => IO.pure(Socket & String, (s, text)), _ => s => next(s)(text))(socket)