Package

com.bazaarvoice.support.scala

service

Permalink

package service

Visibility
  1. Public
  2. All

Type Members

  1. class LatencyAwareServicePool[T] extends AnyRef

    Permalink

    A lightweight service pool implementation with latency awareness.

    A lightweight service pool implementation with latency awareness.

    Usage:

    type Host = String
    val pool = new LatencyAwareServicePool[Host]()
    pool.setProviders(initialProvidersList)
    
    def queryThing() = pool.execute { host =>
      LOG.info(s"querying $host")
      doQuery(host)
    }
    
    def renewProviderList(updatedProviders: Set[Host]) = pool.setProviders(updatedProviders)

    When you provide an updated providers list, the service pool will compare the new list with the current providers, preserving the statistics for hosts it already knows about, adding new hosts, and dropping hosts that are not present in the new list.

    T

    The type of the service to track. Can be anything.

Value Members

  1. object LatencyAwareServicePool

    Permalink

Ungrouped