Close the resource with the given deadline exactly once.
Close the resource with the given deadline exactly once. This deadline is advisory, giving the callee some leeway, for example to drain clients or finish up other tasks.
if this method throws a synchronous exception, that exception will be wrapped in a failed future. If a fatal error is thrown synchronously, the error will be wrapped in a failed Future AND thrown directly.
The Future satisfied upon completion of close.
we do not expose direct access to the underlying closePromise, because the Promise state is mutable - we only want mutation to occur within this CloseOnce trait.
Signals whether or not this Closable has been closed.
A mixin trait to describe resources that are an idempotent Closable.
The first call to
close(Time)
triggers closing the resource with the provided deadline while subsequent calls will yield the sameFuture
as the first invocation irrespective of the deadline provided.ClosableOnce.of for creating a proxy to a Closable that has already been instantiated.
ClosableOnce if you are not mixing in or extending an existing Closable