def talk.send
bend-kit-http@0.38.2.0 · http.bend:5951
import bend-kit-http@0.38.2.0/http.bend as Http
import Base
import bend-kit-http@0.38.2.0/completion.bend as Completion
import bend-kit-time@0.3.0.0/time.bend as Time
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
5951def talk.send(+settings: Limits, s: Socket, rest: Bytes.Bytes, +headers: Map<&2, List<&2, String>>, v11: Bool, +head: Bool, res: Res) -> IO((Socket & Turn) & Completion.Outcome):
5952 Limits{max, cap, hm, bm, im, wm} = settings
5953 Res{+status, +rh, body} = res
5954 +keep = serve.keep(headers, v11, status, rh)
5955 do IO<(Socket & Turn) & Completion.Outcome>:
5956 now : Time.Duration <- Time.mono()
5957 sent : Socket & Result<&1, &1, U32 & String, Unit> <-
5958 bounded.send(s, reply.bytes(Res{status, rh, body}, head, Bool.not(keep)), Time.Duration.add(now, Time.Duration.of_ms(wm)))
5959 return talk.after(settings, keep, rest, sent)