def conn.admitted
bend-kit-http@0.38.5.0 · http.bend:6253
import bend-kit-http@0.38.5.0/http.bend as Http
import Base
import bend-kit-http@0.38.5.0/admission.bend as Admission
import bend-kit-http@0.38.5.0/completion.bend as Completion
6253def conn.admitted(~h: Req -> IO(Reply), ~observe: U32 -> Completion.Outcome -> IO(Unit), admitted: Bool, +settings: Limits, +inbox: Chan(Admission.Command), l: Listener, s: Socket) -> IO(Listener):
6254 match admitted:
6255 case False{}:
6256 do IO<Listener>:
6257 Socket.close(s)
6258 return l
6259 case True{}:
6260 do IO<Listener>:
6261 IO.spawn(Unit, admission.done(inbox, talk(~Unit, ~(context => req => h(req)), ~(context => status => outcome => observe(status, outcome)), Unit{}, settings, inbox,
6262 Some{Serving{(s, TurnMore{sv.none(), False{}}), None{}}})))
6263 return l