def bounded.send.ready

bend-kit-http@0.38.2.0 · http.bend:5563

import bend-kit-http@0.38.2.0/http.bend as Http
import Base
import bend-kit-wire@0.4.7.0/wire.bend as Wire
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

5563def bounded.send.ready(expired: Bool, s: Socket, b: Bytes.Bytes, ms: U32) -> IO(Socket & Result<&1, &1, U32 & String, Unit>):
5564  match expired:
5565    case True{}:
5566      IO.pure(Socket & Result<&1, &1, U32 & String, Unit>, (s, Fail{(60, "write deadline expired")}))
5567    case False{}:
5568      Bytes.Bytes{len, words} = b
5569      do IO<Socket & Result<&1, &1, U32 & String, Unit>>:
5570        sent : Socket & (U32 & Result<&1, &1, U32 & String, Unit>) <- Wire.send.words.deadline(s, len, words, ms)
5571        return bounded.sent(sent)

Uses (14)

Used by (1)