Add unsubscribers to the list. Note that duplicates are not added twice.
Once runAllUnsubscribers has started, unsubscribers are run immediately rather than stored. Nothing can await that run, so its outcome — success included — is only reported.
Objects that were returned from a registration process.
Run all unsubscribers added to this list, clear the list, and seal it so anything added later is unsubscribed on arrival.
An unsubscriber that throws (synchronously or asynchronously) does not make this method reject:
the error is caught and logged via console.error, the remaining unsubscribers still run, and
the thrower counts as a failure in the return value. An unsubscriber that arrives during the
run is not part of the returned result — nothing is waiting on it by then.
true if all unsubscribers succeeded, false if any returned false or threw.
Simple collection for UnsubscriberAsync objects that also provides an easy way to run them.
A list is single-use: it collects unsubscribers until runAllUnsubscribers runs them, and that run seals it for good. Anything added to a sealed list is unsubscribed immediately instead of being stored, because whatever these clean up after is already gone. Registration is usually asynchronous, so an unsubscriber routinely arrives after the teardown that should have run it — without sealing it would be stored in a list nobody drains again and its subscription would leak for the rest of the session.