Package

com.gilt.gfc

concurrent

Permalink

package concurrent

Visibility
  1. Public
  2. All

Type Members

  1. trait AsyncScheduledExecutorService extends ScheduledExecutorService

    Permalink

    Functions for scheduling of asynchronous tasks

  2. trait ExecutorService extends java.util.concurrent.ExecutorService

    Permalink

    Scala adaptations of j.u.c.ExecutorService.

  3. case class FutureBuilder[A, R] extends Product with Serializable

    Permalink

    A convenience wrapper around Future-based calls.

    A convenience wrapper around Future-based calls.

    Typically we have an API that returns some Future[OpResult] and we need to set an operation timeout, possibly provide a default value, possibly log how long it took for debugging, maybe retry.

    By default it builds a Future[Try[A]] from Future[A]. When default value is provided it builds Future[A] from Future[A]. At the very minimum it'll apply a mandatory timeout but you can add retry logic, call tracer, etc.

    It is important to specify type A _at_the_time_of_creation_, type inference doesn't pick it up.

    FutureBuilder[Option[Foo]]("FooCall")......

    We want to apply timeouts to *all* Futures, so,

    ...futureBuilder.runWithTimeout(100 milliseconds){ .... something that returns Future ... }
  4. trait JExecutorServiceWrapper extends ExecutorService

    Permalink

    Wrapper of a java.util.concurrent.ExecutorService implementing the com.gilt.gfc.concurrent.ExecutorService trait.

  5. trait JScheduledExecutorServiceWrapper extends JExecutorServiceWrapper with AsyncScheduledExecutorService

    Permalink

    Wrapper of a java.util.concurrent.ScheduledExecutorService implementing the com.gilt.gfc.concurrent.AsyncScheduledExecutorService trait.

  6. trait ScheduledExecutorService extends java.util.concurrent.ScheduledExecutorService with ExecutorService

    Permalink

    Scala adaptations of j.u.c.ScheduledExecutorService.

  7. case class ThreadFactoryBuilder extends Product with Serializable

    Permalink
  8. case class ThreadGroupBuilder extends Product with Serializable

    Permalink

Value Members

  1. object AwaitResult

    Permalink

    Curried version of Scala's Await, for convenience.

    Curried version of Scala's Await, for convenience.

    AwaitResult(1 second) { futureBasedCall() }
  2. object FutureBuilder extends Serializable

    Permalink
  3. object JavaConversions

    Permalink

    Implicit conversions from java.util.concurrent.ExecutorService and java.util.concurrent.ScheduledExecutorService to com.gilt.gfc.concurrent.ExecutorService and com.gilt.gfc.concurrent.AsyncScheduledExecutorService

  4. object JavaConverters

    Permalink

    Implicit conversions between scala functions and Java equivalents.

  5. object SameThreadExecutionContext extends ExecutionContext with Loggable

    Permalink

    For small code blocks that don't need to be run on a separate thread.

  6. object ScalaFutures

    Permalink

    Little helpers for scala futures

    Little helpers for scala futures

    Since

    11/Jul/2014 13:25

  7. object ThreadFactoryBuilder extends Serializable

    Permalink

    Simple ThreadFactoryBuilder, analogous to guava ThreadFactoryBuilder

  8. object ThreadGroupBuilder extends Serializable

    Permalink

    Simple Builder for java.lang.ThreadGroup

    Simple Builder for java.lang.ThreadGroup

    By default groups have the daemon flag set to false, as such a group will destroy itself if it ever becomes empty after having at least one thread, for example if the factory is used to create threads for an infrequently-used cached thread pool.

    Since

    09/Feb/2015 12:01

  9. object Timeouts

    Permalink

    Factory module to build timing out Futures.

    Factory module to build timing out Futures.

    Since

    22-Nov-2014

  10. package trace

    Permalink

Ungrouped