Camber.server.response: def of bend-kit-camber@0.15.0.1 Import: import bend-kit-camber@0.15.0.1/camber.bend as Camber Lines 1080-1099 of bend-kit-camber@0.15.0.1/camber.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-camber@0.15.0.1/camber.bend&start_line=1080&end_line=1099 import Base import bend-kit-http@0.38.1.1/http.bend as Http import bend-kit-http@0.38.1.1/completion.bend as TransportCompletion import bend-kit-time@0.3.0.0/time.bend as Time def server.response(~K: Data, ~H: Data, ~done: TransportCompletion.Completion> -> IO(Unit), config: K, started: Time.Duration, outcome: Outcome>, +body: Chan(Http.Body), +response: Chan(Http.Res) ) -> IO(Http.Reply): match outcome: case Success{report}: do IO: result : Http.Res <- receive(Http.Res, response) Chan.close(Http.Body, body) Chan.close(Http.Res, response) return Http.reply.complete(~NoticePayload, ~done, NoticePayload{config, started, report}, result) case _: do IO: # Closing alone retains buffered values in Base. Consume the rejected # body before closing; the single room1 send has already completed. discarded : Http.Body <- receive(Http.Body, body) Chan.close(Http.Body, body) Chan.close(Http.Res, response) return Http.reply.complete(~NoticePayload, ~done, NoticePayload{config, started, CapacityRejected{}}, Http.Res{503, Http.set(Http.empty(), "connection", "close"), Http.from_string("")}) Uses (19): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Chan https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Chan.close https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=ApplicationReport https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=NoticePayload https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=Outcome https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=receive https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.4.0/completion.bend&name=Completion https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.4.0/http.bend&name=Body https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.4.0/http.bend&name=Reply https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.4.0/http.bend&name=Res https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.4.0/http.bend&name=empty https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.4.0/http.bend&name=from_string https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.4.0/http.bend&name=reply.complete https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.4.0/http.bend&name=set https://jend.leeeet.dev/definition.txt?path=bend-kit-time@0.3.0.0/time.bend&name=Duration