def server.accepted

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

import bend-kit-http@0.38.2.0/http.bend as Http
import Base
import bend-kit-http@0.38.2.0/admission.bend as Admission

6422def server.accepted(~C: Data, ~operation: C -> Limits -> Chan(Admission.Command) -> Socket -> IO(Unit), +context: C, +config: ServerConfig, +inbox: Chan(Admission.Command), drained: Chan(Admission.Counts), result: Listener & Result<&1, &1, U32 & String, Socket>) -> IO(Server<C> & Result<&1, &1, U32 & String, Chan(Unit)>):
6423  (listener, got) = result
6424  match got:
6425    case Fail{error}:
6426      IO.pure(Server<C> & Result<&1, &1, U32 & String, Chan(Unit)>, (Server{listener, context, config, inbox, drained}, Fail{error}))
6427    case Done{socket}:
6428      do IO<Server<C> & Result<&1, &1, U32 & String, Chan(Unit)>>:
6429        admitted : Bool <- Admission.take(inbox, 0)
6430        server.admitted(~C, ~operation, admitted, context, config, inbox, drained, listener, socket)

Uses (20)

Used by (1)