SIGN IN SIGN UP

internal/grpcsync: add ScheduleAndWait to CallbackSerializer (#9162)

Adds `ScheduleAndWait` to `CallbackSerializer`. It schedules a callback
and blocks until the callback has run. If the serializer was already
closed before the callback could be scheduled, it returns
`ErrSerializerClosed`, so callers can tell whether the callback actually
ran.

This replaces the common pattern of calling `ScheduleOr` with a `done`
channel just to wait for a callback to finish.

Implements the design discussed in #8501.

Fixes #8501

RELEASE NOTES: none
U
ulas committed
50139749cb5bc50dd672689549340fceac494c1b
Parent: bd58bc0
Committed by GitHub <noreply@github.com> on 7/1/2026, 11:37:25 AM