package util
- Alphabetic
- By Inheritance
- util
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
class
AsyncLatch
extends AnyRef
A construct providing latched, asynchronous execution of side-effecting functions.
A construct providing latched, asynchronous execution of side-effecting functions. com.twitter.finagle.util.AsyncLatch#await does not block, but the execution of functions passed to it may be delayed. That is, because the latch guarantees serial, non-concurrent execution, functions passed to
await
may have to wait until both of the following conditions are met:1. No other functions are being executed 2. The latch's count is zero
Thus, calling com.twitter.finagle.util.AsyncLatch#incr will cause subsequent functions passed to com.twitter.finagle.util.AsyncLatch#await to be delayed until the count is decremented to zero. Once the count is zero, functions are executed in the order that they are provided to
await
. - trait Chan [-T] extends AnyRef
-
trait
CloseNotifier
extends AnyRef
Allows resources to register their handlers to be invoked when service is closing.
- trait Drv extends (Rng) ⇒ Int
-
trait
OnReady
extends AnyRef
A base type for something that signals its readiness asynchronously.
-
trait
Proc
[-T] extends Chan[T]
A Proc is a process that can receive messages.
A Proc is a process that can receive messages. Procs guarantee that exactly one message is delivered at a time, and that they are delivered in the order received.
They can be thought of as featherweight actors.
- trait ReporterFactory extends (String, Option[SocketAddress]) ⇒ Monitor
-
class
Ring
extends AnyRef
Class
Ring
implements a hash ring.Class
Ring
implements a hash ring. Given an array mapping indices to positions, the ring supplies the reverse mapping: to which index does a position belong?Its distinguishing feature is that
Ring
can pick random positions in a range. (And then map them to their corresponding indices.) Ring can also pick without replacement two elements from a range.val r = new Ring(Array(1,5,20)) r(0) == 0 r(1) == 0 r(2) == 1 r(5) == 1 r(6) == 2 r(20) == 2 r(21) == 0 // Wraps around; it's a ring!
-
trait
Rng
extends AnyRef
A random number generator.
A random number generator. Java's divergent interfaces forces our hand here: ThreadLocalRandom does not conform to java.util.Random. We bridge this gap.
-
trait
Showable
[-T] extends AnyRef
Trait showable is a type-class for showing parseable representations of objects.
-
trait
StackRegistry
extends AnyRef
A registry that allows the registration of a string identifier with a a com.twitter.finagle.Stack and its params.
A registry that allows the registration of a string identifier with a a com.twitter.finagle.Stack and its params. This is especially useful in keeping a process global registry of Finagle clients and servers for dynamic introspection.
Value Members
- val DefaultLogger: Logger
- object ByteArrays
- object CloseNotifier
-
object
DefaultTimer
Retained for compatibility.
Retained for compatibility. Prefer HashedWheelTimer.
-
object
Drv
Create discrete random variables representing arbitrary distributions.
-
object
ExitGuard
ExitGuard prevents the process from exiting normally by use of a nondaemon thread whenever there is at least one guarder.
-
object
HashedWheelTimer
A HashedWheelTimer that uses org.jboss.netty.util.HashedWheelTimer under the hood.
A HashedWheelTimer that uses org.jboss.netty.util.HashedWheelTimer under the hood. Prefer using a single instance per application, the default instance is HashedWheelTimer.Default.
- object InetSocketAddressUtil
-
object
LoadService
Load a singleton class in the manner of java.util.ServiceLoader.
Load a singleton class in the manner of java.util.ServiceLoader. It is more resilient to varying Java packaging configurations than ServiceLoader.
- See also
com.twitter.app.LoadService
in util-app
- object LoadedReporterFactory extends ReporterFactory
- object NullReporterFactory extends ReporterFactory
- object Proc
- object Ring
-
object
Rng
See Rngs for Java compatible APIs.
-
object
Rngs
Java compatible forwarders.
- object Showable
- object StackRegistry