com.twitter.finagle

service

package service

Visibility
  1. Public
  2. All

Type Members

  1. class ConstantService[Req, Rep] extends Service[Req, Rep]

    A com.twitter.finagle.Service that returns a constant result.

  2. class DelayedFactory[Req, Rep] extends ServiceFactory[Req, Rep]

    A factory that won't satisfy the service future until an underlying service factory is ready.

    A factory that won't satisfy the service future until an underlying service factory is ready.

    close closes the underlying service factory, which means that it won't be satisfied until after the underlying future has been satisfied.

    Note

    Implicitly masks the underlying future from interrupts. Promises are detached on interruption.

  3. abstract class ExpiringService[Req, Rep] extends ServiceProxy[Req, Rep]

    A service wrapper that expires the self service after a certain amount of idle time.

    A service wrapper that expires the self service after a certain amount of idle time. By default, expiring calls .close() on the self channel, but this action is customizable.

  4. class FailedService extends ConstantService[Any, Nothing]

    A com.twitter.finagle.Service that fails with a constant Throwable.

  5. class FailingFactory[Req, Rep] extends ServiceFactory[Req, Rep]

    A com.twitter.finagle.ServiceFactory that fails to construct services.

  6. class FailureAccrualFactory[Req, Rep] extends ServiceFactory[Req, Rep]

    A com.twitter.finagle.ServiceFactory that accrues failures, marking itself unavailable when deemed unhealthy according to its parameterization.

    A com.twitter.finagle.ServiceFactory that accrues failures, marking itself unavailable when deemed unhealthy according to its parameterization.

    TODO: treat different failures differently (eg. connect failures vs. not), enable different backoff strategies.

  7. case class KetamaShardingServiceBuilder[Req, Rep](_nodes: Option[Seq[KetamaNode[Service[Req, Rep]]]] = None, _hash: Option[(Req) ⇒ Option[Long]] = None, _numReps: Int = 160) extends Product with Serializable

  8. class LocalRateLimitingStrategy[Req] extends (Req) ⇒ Future[Boolean]

    Strategy responsible for tracking requests and computing rate per client.

  9. class OptionallyServableFilter[Req, Rep] extends SimpleFilter[Req, Rep]

    A com.twitter.finagle.Filter that uses an argument function to predicate whether or not to apply the subsequent com.twitter.finagle.Service.

    A com.twitter.finagle.Filter that uses an argument function to predicate whether or not to apply the subsequent com.twitter.finagle.Service. In cases where the function returns false, a the filter fails with a com.twitter.finagle.NotServableException.

  10. class RateLimitingFilter[Req, Rep] extends SimpleFilter[Req, Rep]

    A com.twitter.finagle.Filter that accepts or refuses requests based on a rate limiting strategy.

  11. abstract class RetryPolicy[-A] extends (A) ⇒ Option[(Duration, RetryPolicy[A])]

    A function defining retry behavior for a given value type A.

  12. class RetryingFilter[Req, Rep] extends SimpleFilter[Req, Rep]

    A com.twitter.finagle.Filter that coordinatess retries of subsequent Services.

    A com.twitter.finagle.Filter that coordinatess retries of subsequent Services. Requests can be classified as retryable via the argument com.twitter.finagle.service.RetryPolicy.

  13. class ShardingService[Req, Rep] extends Service[Req, Rep]

    ShardingService takes a Distributor where the handle is a service.

    ShardingService takes a Distributor where the handle is a service. It uses the distributor to distribute requests *only* when the hash function returns Some[Long]. If None is returned, it throws NotShardableException. If the underlying service for a particular shard is not available, NotServableException is thrown. Example: val serviceFactory = KetamaShardingServiceBuilder() .nodes(services) // services is of type Seq[(String, Service[Req,Rep])] .withHash { req => Some(hashCodeOfSomething)} .buildFactory() val service = serviceFactory() service(req) // where req is a Req and may have ShardableRequest mixed in

  14. abstract class SimpleRetryPolicy[A] extends RetryPolicy[A] with (A) ⇒ Option[(Duration, RetryPolicy[A])]

    A retry policy abstract class.

    A retry policy abstract class. This is convenient to use for Java programmers. Simply implement the two abstract methods shouldRetry and backoffAt and you're good to go!

  15. class SingletonFactory[Req, Rep] extends ServiceFactory[Req, Rep]

    A com.twitter.finagle.ServiceFactory that produces Services identical to the argument service.

    A com.twitter.finagle.ServiceFactory that produces Services identical to the argument service.

    Note that this factory builds new Services, so the "singleton" service argument is not shared by reference. This differs from com.twitter.finagle.ServiceFactory#const in that const proxies all requests to the same service rather than creating new objects.

  16. class StatsFilter[Req, Rep] extends SimpleFilter[Req, Rep]

    StatsFilter reports request statistics to the given receiver.

    StatsFilter reports request statistics to the given receiver.

    Note

    The innocent bystander may find the semantics with respect to backup requests a bit puzzling; they are entangled in legacy. "requests" counts the total number of requests: subtracting "success" from this produces the failure count. However, this doesn't allow for "shadow" requests to be accounted for in "requests". This is why we don't increment "requests" on backup request failures.

  17. class StatsServiceFactory[Req, Rep] extends ServiceFactoryProxy[Req, Rep]

  18. class TimeoutFilter[Req, Rep] extends SimpleFilter[Req, Rep]

    A com.twitter.finagle.Filter that applies a global timeout to requests.

Value Members

  1. object Backoff

    Implements various backoff strategies.

    Implements various backoff strategies. Strategies are defined by a Stream[Duration] and intended for use with com.twitter.finagle.service.RetryingFilter#backoff to determine the duration after which a request is to be retried

  2. object DelayedFactory

  3. object ExpiringService

  4. object FailFastFactory

  5. object FailureAccrualFactory

  6. object NilService extends FailedService

    A static com.twitter.finagle.FailedService object.

  7. object RetryPolicy extends JavaSingleton

  8. object RetryingFilter

  9. object RetryingService

  10. object StatsFilter

  11. object TimeoutFilter

Ungrouped