Package

com.twitter.finagle

util

Permalink

package util

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. util
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class AsyncLatch extends AnyRef

    Permalink

    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.

  2. trait Chan[-T] extends AnyRef

    Permalink
  3. trait CloseNotifier extends AnyRef

    Permalink

    Allows resources to register their handlers to be invoked when service is closing.

  4. class ConcurrentRingBuffer[T] extends AnyRef

    Permalink

    A simple, lock-free, non-blocking ring buffer.

    A simple, lock-free, non-blocking ring buffer.

    This differs from com.twitter.util.RingBuffer in that it is simpler (fewer features), and is fully concurrent (and hence also threadsafe). This should probably be moved into util at some point.

    Note: For very high-rate usages, sizing buffers by powers of two may be advantageous.

    Caveats: References are kept to old entries until they are overwritten again. You can get around this by storing nullable references (though this would require another allocation for each item).

  5. trait Drv extends (Rng) ⇒ Int

    Permalink
  6. trait OnReady extends AnyRef

    Permalink

    A base type for something that signals its readiness asynchronously.

  7. trait Proc[-T] extends Chan[T]

    Permalink

    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.

  8. trait ReporterFactory extends (String, Option[SocketAddress]) ⇒ Monitor

    Permalink
  9. class Ring extends AnyRef

    Permalink

    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!
  10. trait Rng extends AnyRef

    Permalink

    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.

  11. trait Showable[-T] extends AnyRef

    Permalink

    Trait showable is a type-class for showing parseable representations of objects.

  12. trait StackRegistry extends AnyRef

    Permalink

    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

  1. object ByteArrays

    Permalink
  2. object CloseNotifier

    Permalink
  3. val DefaultLogger: Logger

    Permalink
  4. object DefaultMonitor extends DefaultMonitor

    Permalink

    The default Monitor to be used throughout Finagle.

    The default Monitor to be used throughout Finagle.

    Mostly delegates to RootMonitor, with the exception of HasLogLevels with a logLevel below INFO. TimeoutExceptions are also suppressed because they often originate from Future.within and Future.raiseWithin.

  5. object DefaultTimer

    Permalink

    Retained for compatibility.

    Retained for compatibility. Prefer HashedWheelTimer.

  6. object Drv

    Permalink

    Create discrete random variables representing arbitrary distributions.

  7. object ExitGuard

    Permalink

    ExitGuard prevents the process from exiting normally by use of a nondaemon thread whenever there is at least one guarder.

  8. object HashedWheelTimer

    Permalink

    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.

  9. object InetSocketAddressUtil

    Permalink
  10. object LoadService

    Permalink

    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

  11. object LoadedReporterFactory extends ReporterFactory

    Permalink
  12. object NullReporterFactory extends ReporterFactory

    Permalink
  13. object Proc

    Permalink
  14. object Ring

    Permalink
  15. object Rng

    Permalink

    See Rngs for Java compatible APIs.

  16. object Rngs

    Permalink

    Java compatible forwarders.

  17. object Showable

    Permalink
  18. object StackRegistry

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped