def dispatch.completed

bend-kit-camber@0.15.0.1 · camber.bend:946

import bend-kit-camber@0.15.0.1/camber.bend as Camber
import Base
import bend-kit-http@0.38.1.1/http.bend as Http
import bend-kit-camber@0.15.0.1/notices.bend as Notices
import bend-kit-time@0.3.0.0/time.bend as Time

946def dispatch.completed(~S: Type, ~N: Data, ~H: Data, ~E: Data,
947  ~notify: N -> Policy<H> -> Notices.Notice -> IO(Result<&2, &2, E, Unit>),
948  ~report: N -> E -> IO(Unit),
949  observer: N, access: Notices.Access, started: Time.Duration, completion: Completion<S, H>
950) -> IO(Completion<S, H>):
951  Completed{state, Http.Res{+status, headers, body}, +entered, +mapped, +stopped} = completion
952  do IO<Completion<S, H>>:
953    ended : Time.Duration <- Time.mono()
954    +notice : Notices.Notice = Notices.Notice{status, Time.Duration.sub(ended, started), mapped, stopped, Notices.ApplicationOnly{}}
955    notices(~N, ~H, ~E, ~notify, ~report, entered, observer, notice)
956    Notices.access(access, notice)
957    return Completed{state, Http.Res{status, headers, body}, entered, mapped, stopped}

Uses (16)

Used by (1)