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 e59fbaab64
util/eventbus: give a nicer error when attempting to use a closed client (#17208)
It is a programming error to Publish or Subscribe on a closed Client, but now
the way you discover that is by getting a panic from down in the machinery of
the bus after the client state has been cleaned up.

To provide a more helpful error, let's panic explicitly when that happens and
say what went wrong ("the client is closed"), by preventing subscriptions from
interleaving with closure of the client. With this change, either an attachment
fails outright (because the client is already closed) or completes and then
shuts down in good order in the normal course.

This does not change the semantics of the client, publishers, or subscribers,
it's just making the failure more eager so we can attach explanatory text.

Updates #15160

Change-Id: Ia492f4c1dea7535aec2cdcc2e5ea5410ed5218d2
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 health: remove direct callback and replace with eventbus (#17199) 3 months ago
bench_test.go util/eventbus: add basic throughput benchmarks (#15284) 9 months ago
bus.go util/eventbus: fix docstrings (#16401) 5 months ago
bus_test.go util/eventbus: give a nicer error when attempting to use a closed client (#17208) 3 months ago
client.go util/eventbus: give a nicer error when attempting to use a closed client (#17208) 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
monitor.go util/eventbus: add a Monitor type to manage subscriber goroutines (#17127) 3 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 9 months ago
subscribe.go util/eventbus: remove redundant code from eventbus.Publish 6 months ago