def talk.send
bend-kit-http@0.38.5.0 · http.bend:5943
import bend-kit-http@0.38.5.0/http.bend as Http
import Base
import bend-kit-http@0.38.5.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
5943def 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):
5944 Limits{max, cap, hm, bm, im, wm} = settings
5945 Res{+status, +rh, body} = res
5946 +keep = serve.keep(headers, v11, status, rh)
5947 do IO<(Socket & Turn) & Completion.Outcome>:
5948 now : Time.Duration <- Time.mono()
5949 sent : Socket & Result<&1, &1, U32 & String, Unit> <-
5950 bounded.send(s, reply.bytes(Res{status, rh, body}, head, Bool.not(keep)), Time.Duration.add(now, Time.Duration.of_ms(wm)))
5951 return talk.after(settings, keep, rest, sent)