def poll

cswap-bend-cli@0.1.0.0 · daemon/events.bend:122

import cswap-bend-cli@0.1.0.0/daemon/events.bend as Events
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json

122# fetchErrors and windowsPct appear only when non-empty.
123def poll(+ts: String, +active: Json.Json, +rows: List<&2, Row>, +threshold: U32) -> Json.Json:
124  event("poll", ts, pair("active", active, pair("headroomPct", Json.JObj{headroom_chain(rows)}, pair("threshold", fl(threshold),
125    opt_obj(errors_all(rows), "fetchErrors", opt_obj(windows_all(rows), "windowsPct", Json.JNil{}))))))

Uses (12)

Used by (2)