def conn.admitted
bend-kit-http@0.38.2.0 · http.bend:6261
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
import bend-kit-http@0.38.2.0/completion.bend as Completion
6261def 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):
6262 match admitted:
6263 case False{}:
6264 do IO<Listener>:
6265 Socket.close(s)
6266 return l
6267 case True{}:
6268 do IO<Listener>:
6269 IO.spawn(Unit, admission.done(inbox, talk(~Unit, ~(context => req => h(req)), ~(context => status => outcome => observe(status, outcome)), Unit{}, settings, inbox,
6270 Some{Serving{(s, TurnMore{sv.none(), False{}}), None{}}})))
6271 return l