Abstract Closable
class for Java compatibility.
Abstract Event
class for Java compatibility.
Abstract Var
class for Java compatibility.
Abstract Witness
class for Java compatibility.
An Activity is a handle to a concurrently running process, producing T-typed values.
Wait for the result of some action.
A "stack" with a bounded size.
Defines a trait that makes the underlying object *cancellable*.
Closable is a mixin trait to describe a closable
.resource
A mixin to make an com.twitter.util.Awaitable out of a com.twitter.util.Closable.
A base trait for all Codecs that translate a type T into a serialized form S
A Future that is already completed.
Java interface to Credentials.
A base trait for decoders for type T from a serialized form S
A Diff stores the necessary instructions required to bring two version of a data structure into agreement.
A type class that tells how to compute a Diff between
two versions of a collection CC[T]
.
com.twitter.util.Disposable represents a live resource that must be disposed after use.
A Duration
represents the span between two points in time.
A base trait for encoders of type T into a serialized form S
Events are instantaneous values, defined only at particular instants in time (cf.
A FuturePool implementation backed by an ExecutorService.
This class is for Java friendliness.
A computation evaluated asynchronously.
An alternative interface for handling Future Events.
A FuturePool executes tasks asynchronously, typically using a pool of worker threads.
An alternative interface for performing Future transformations; that is, converting a Future[A] to a Future[B].
A mixin to allow scala objects to be used from java.
An implementation of java.
A Local is a ThreadLocal whose scope is flexible.
Managed[T]
is a resource of type T
which lifetime is explicitly managed.
A Monitor is a composable exception handler.
Wraps an exception that happens when handling another exception in a monitor.
A future with no future (never completes).
A NullTimer is not a timer at all: it invokes all tasks immediately and inline.
A writeable com.twitter.util.Future that supports merging.
Java adaptation of Var[T] with Updatable[T] with Extractable[T]
.
RichU64String parses string as a 64-bit unsigned hexadecimal long, outputting a signed Long or a byte array.
A stopwatch may be used to measure elapsed time.
Representation of storage units.
Test mixin that creates a new folder for a block of code to execute in.
An absolute point in time, represented as the number of nanoseconds since the Unix epoch.
A thread-safe wrapper around a SimpleDateFormat object.
A common trait for time-like values.
Timers are used to schedule tasks in the future.
TimerTasks represent pending tasks scheduled by a Timer.
This class represents a computation that can succeed or fail.
Denotes an updatable container.
Trait Var represents a variable.
A witness is the recipient of Event.
A Java analog of Event[A]()
.
A bijection is a function for which every value in its codomain (set of all possible results) is equivalent to application of the function on a unique value in its domain (all possible inputs).
A config object contains vars for configuring an object of type T, and an apply() method which turns this config into an object of type T.
(Since version 2014-10-11) Use com.google.common.collect.EvictingQueue instead
Note: There is a Java-friendly API for this object: com.twitter.util.Activities.
Await the result of some action.
Efficient conversion of Longs to base 64 encoded strings.
Note: There is a Java-friendly API for this object: com.twitter.util.Closables.
Simple helper to read authentication credentials from a text file.
Diffable defines common type class instances for Diffable.
Note: There is a Java-friendly API for this object: com.twitter.util.Events.
Twitter Future utility methods for ease of use from java
Defines the (Future)-{{Local}} monitor as well as some monitor utilities.
A trivial implementation of com.twitter.util.Stopwatch for use as a null object.
A classifier of fatal exceptions
A monitor that always fails to handle an exception.
A generator of random local java.net.InetSocketAddress objects with ephemeral ports.
The system com.twitter.util.Stopwatch measures elapsed time
using System.nanoTime
.
Use Time.now
in your program instead of
System.currentTimeMillis
, and unit tests will be able to adjust
the current time to verify timeouts and other time-dependent
behavior, without calling sleep
.
The Try type represents a computation that may either result in an exception or return a success value.
Note: There is a Java-friendly API for this object: com.twitter.util.Vars.
Note: There is Java-friendly API for this object: com.twitter.util.Witnesses.