You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/util/eventbus
M. J. Fromberger 5b5ae2b2ee
util/eventbus: add a Done channel to the Client (#17118)
Subscribers already have a Done channel that the caller can use to detect when
the subscriber has been closed. Typically this happens when the governing
Client closes, which in turn is typically because the Bus closed.

But clients and subscribers can stop at other times too, and a caller has no
good way to tell the difference between "this subscriber closed but the rest
are OK" and "the client closed and all these subscribers are finished".

We've worked around this in practice by knowing the closure of one subscriber
implies the fate of the rest, but we can do better: Add a Done method to the
Client that allows us to tell when that has been closed explicitly, after all
the publishers and subscribers associated with that client have been closed.
This allows the caller to be sure that, by the time that occurs, no further
pending events are forthcoming on that client.

Updates #15160

Change-Id: Id601a79ba043365ecdb47dd035f1fdadd984f303
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
3 months ago
..
assets util/eventbus: add a debug HTTP handler for the bus 9 months ago
debug-demo util/eventbus: add a helper program for bus development 9 months ago
eventbustest control/controlclient: introduce eventbus messages instead of callbacks (#16956) 3 months ago
bench_test.go util/eventbus: add basic throughput benchmarks (#15284) 9 months ago
bus.go util/eventbus: fix docstrings (#16401) 6 months ago
bus_test.go util/eventbus: add a Done channel to the Client (#17118) 3 months ago
client.go util/eventbus: add a Done channel to the Client (#17118) 3 months ago
debug.go client/local,cmd/tailscale/cli,ipn/localapi: expose eventbus graph (#16597) 5 months ago
debughttp.go util/eventbus: add ts_omit_debugeventbus 3 months ago
debughttp_off.go util/eventbus: add ts_omit_debugeventbus 3 months ago
doc.go util/eventbus: add test helpers to simplify testing events (#16294) 6 months ago
fetch-htmx.go util/eventbus: add a debug HTTP handler for the bus 9 months ago
publish.go util/eventbus: remove redundant code from eventbus.Publish 6 months ago
queue.go util/eventbus: make internal queue a generic type 10 months ago
subscribe.go util/eventbus: remove redundant code from eventbus.Publish 6 months ago