The AsyncLatch is an asynchronous latch.
Allows resources to register their handlers to be invoked when service is closing.
A simple, lock-free, non-blocking ring buffer.
Disposable is a container for a resource that must be explicitly disposed when no longer needed.
A Finagle-managed timer, with interfaces for both {{com.
Managed[T] is a resource of type T which lifetime is explicitly managed.
A Proc is a process that can receive messages.
Implements a com.twitter.util.Timer in terms of a org.jboss.netty.util.Timer.
ExitGuard prevents the process from exiting normally by use of a nondaemon thread whenever there is at least one guarder.
Load a singleton class using java.util.ServiceLoader.
Resource Management
Disposable represents a live resource that must be disposed after use. Managed is a factory for creating and composing such resources. Managed resources are composed together so their lifetimes are synchronized.
The following example shows how to build and use composite managed resources:
Disposable/Managed Semantics
Disposable: get can be called multiple times and should return same instance; dispose can be called only once and should release resource that get is returning; calling get after dispose is undefined.
Managed: multiple calls to make could return a) new instance or b) ref counted instance of the underlying resource or c) same instance when resource doesn't need to be actually disposed, etc.