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.
Provides an interface for working with a batched com.twitter.util.Future
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 java.util.concurrent.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 FuturePool backed by a java.util.concurrent.ExecutorService
that supports cancellation.
A mixin to allow scala objects to be used from java.
A Timer that is implemented via a java.util.Timer.
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.
Exceedingly useful for writing well-behaved tests that need control over a Timer.
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 temporary thread-local 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.
A token bucket is used to control the relative rates of two processes: one fills the bucket, another empties it.
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 2015-11-16) Use Java's java.lang.ArithmeticException instead
(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.
Synchronously await the result of some action by blocking the current thread.
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.
Note: There is a Java-friendly API for this object: com.twitter.util.FuturePools.
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 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 Stopwatch measures elapsed time using System.nanoTime
.
By using Time.now in your program instead of
System.currentTimeMillis
unit tests are able to adjust
the current time to verify timeouts and other time-dependent
behavior, without calling sleep
, and providing deterministic
tests.
The Try type represents a computation that may either result in an exception or return a success value.
A java.text.SimpleDateFormat
that avoids confusion between YYYY and yyyy.
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.