def emit
import bendonnect-rpc@0.1.0.0/src/transport/client.bend as Clientimport Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
147def emit(~on_msg: Bytes.Bytes -> IO(Unit), collect: Bool, m: Bytes.Bytes, acc: List<&1, Bytes.Bytes>) -> IO(List<&1, Bytes.Bytes>):
148 match collect:
149 case True{}:
150 IO.pure(List<&1, Bytes.Bytes>, m <> acc)
151 case False{}:
152 do IO<List<&1, Bytes.Bytes>>:
153 on_msg(m)
154 return acc