scala

# concurrent

#### package concurrent

This package object contains primitives for concurrent and parallel programming.

Visibility

1. Public
2. All

### Type Members

1. #### trait Awaitable[+T] extends AnyRef

   An object that may eventually be completed with a result value of type `T` which may be awaited using blocking methods.

2. #### trait BlockContext extends AnyRef

   A context to be notified by `scala.concurrent.blocking` when a thread is about to block.

3. #### sealed trait CanAwait extends AnyRef

   Annotations
     @implicitNotFound( msg = ... )

4. #### type CancellationException = CancellationException

   Definition Classes
     package

5. #### class Channel[A] extends AnyRef

   This class .

6. #### class DelayedLazyVal[T] extends AnyRef

   A `DelayedLazyVal` is a wrapper for lengthy computations which have a valid partially computed result.

7. #### trait ExecutionContext extends AnyRef

   An `ExecutionContext` is an abstraction over an entity that can execute program logic.

8. #### trait ExecutionContextExecutor extends ExecutionContext with Executor

   Union interface since Java does not support union types

9. #### trait ExecutionContextExecutorService extends ExecutionContextExecutor with ExecutorService

   Union interface since Java does not support union types

10. #### type ExecutionException = ExecutionException

    Definition Classes
      package

11. #### trait Future[+T] extends Awaitable[T]

    The trait that represents futures.

12. #### trait FutureTaskRunner extends TaskRunner

    The `FutureTaskRunner` trait is a base trait of task runners that provide some sort of future abstraction.

13. #### class Lock extends AnyRef

    This class .

14. #### trait ManagedBlocker extends AnyRef

    The `ManagedBlocker` trait.

15. #### trait OnCompleteRunnable extends AnyRef

    A marker indicating that a `java.lang.Runnable` provided to `scala.concurrent.ExecutionContext` wraps a callback provided to `Future.onComplete`.

16. #### trait Promise[T] extends AnyRef

    Promise is an object which can be completed with a value or failed with an exception.

17. #### class SyncChannel[A] extends AnyRef

    A `SyncChannel` allows one to exchange data synchronously between a reader and a writer thread.

18. #### class SyncVar[A] extends AnyRef

    A class to provide safe concurrent access to a mutable cell.

19. #### trait TaskRunner extends AnyRef

    The `TaskRunner` trait.

20. #### trait ThreadPoolRunner extends FutureTaskRunner

    The `ThreadPoolRunner` trait uses a `java.util.concurrent.ExecutorService` to run submitted tasks.

21. #### class ThreadRunner extends FutureTaskRunner

    The `ThreadRunner` trait.

22. #### type TimeoutException = TimeoutException

    Definition Classes
      package

23. #### trait LinkedListQueueCreator extends AnyRef

    Efficient queue module creator based on linked lists.

24. #### trait ListQueueCreator extends AnyRef

    Inefficient but simple queue module creator.

25. #### class MailBox extends ListQueueCreator

    This class .

26. #### trait QueueModule[A] extends AnyRef

    Module for dealing with queues.

### Value Members

1. #### object Await extends AnyRef

   `Await` is what is used to ensure proper handling of blocking for `Awaitable` instances.

2. #### object BlockContext extends AnyRef

3. #### object ExecutionContext extends AnyRef

   Contains factory methods for creating execution contexts.

4. #### object Future extends AnyRef

   Future companion object.

5. #### object JavaConversions extends AnyRef

   The `JavaConversions` object.

6. #### object Promise extends AnyRef

7. #### object TaskRunners extends AnyRef

   The `TaskRunners` object.

8. #### def blocking[T](body: ⇒ T): T

   Used to designate a piece of code which potentially blocks, allowing the current BlockContext to adjust the runtime's behavior.

   Used to designate a piece of code which potentially blocks, allowing the current BlockContext to adjust the runtime's behavior. Properly marking blocking code may improve performance or avoid deadlocks.

   Blocking on an Awaitable should be done using Await.result instead of `blocking`.

   body

     A piece of code which contains potentially blocking or long running calls.

   Definition Classes
     package
   Annotations
     @throws( clazz = classOf[Exception] )
   Exceptions thrown
     `InterruptedException`

     in the case that a wait within the blocking `body` was interrupted

     `CancellationException`

     if the computation was cancelled

9. #### package duration

10. #### def future[T](body: ⇒ T)(implicit execctx: ExecutionContext): Future[T]

    Starts an asynchronous computation and returns a `Future` object with the result of that computation.

    Starts an asynchronous computation and returns a `Future` object with the result of that computation.

    The result becomes available once the asynchronous computation is completed.

    T

      the type of the result

    body

      the asynchronous computation

    execctx

      the execution context on which the future is run

    returns

      the `Future` holding the result of the computation

    Definition Classes
      package

11. #### object ops extends AnyRef

    The object `ops` .

12. #### def promise[T](): Promise[T]

    Creates a promise object which can be completed with a value or an exception.

    Creates a promise object which can be completed with a value or an exception.

    T

      the type of the value in the promise

    returns

      the newly created `Promise` object

    Definition Classes
      package

### Deprecated Value Members

1. #### object TIMEOUT extends Product with Serializable

   The message sent to a message box when the period specified in `receiveWithin` expires.

2. #### object pilib extends AnyRef

   Library for using Pi-calculus concurrent primitives in Scala.