def server.close

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

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

6383# Only the listener owner closes it, after the current accept really returns.
6384# Joining the controller waits for every real operation, including callbacks.
6385def server.close(~C: Data, server: Server<C>) -> IO(ServerCounts):
6386  Server{listener, context, config, +inbox, drained} = server
6387  do IO<ServerCounts>:
6388    requested : Bool <- Admission.quiesce(inbox)
6389    Listener.close(listener)
6390    Admission.close(inbox)
6391    counts : Admission.Counts <- IO.join(Admission.Counts, drained)
6392    return server.final.counts(counts)

Uses (13)

Used by (2)