LimitedDispatchQueue

A dispatch queue limiting number of concurrently executing tasks. All tasks are executed on parent execution context, but only up to the concurrencyLimit. New tasks, scheduled when the limit is reached, will wait in the queue until one of the current one finishes. Create with one of DispatchQueue.apply methods.

A dispatch queue limiting number of concurrently executing tasks. All tasks are executed on parent execution context, but only up to the concurrencyLimit. New tasks, scheduled when the limit is reached, will wait in the queue until one of the current one finishes. Create with one of DispatchQueue.apply methods.

Companion
object
trait ExecutionContext
class Object
trait Matchable
class Any

Value members

Concrete methods

override def execute(runnable: Runnable): Unit

Schedules a new runnable task to be executed. The task will be added to the queue and then a dispatch executor will run to check if it can be taken from it and executed or if it has to wait until one of the running tasks finishes.

Schedules a new runnable task to be executed. The task will be added to the queue and then a dispatch executor will run to check if it can be taken from it and executed or if it has to wait until one of the running tasks finishes.

Value Params
runnable
  • a task to be executed
See also

java.lang.Runnable

Definition Classes
ExecutionContext
override def hasRemainingTasks: Boolean
Definition Classes
override def reportFailure(cause: Throwable): Unit
Definition Classes
DispatchQueue -> ExecutionContext

Inherited methods

def apply[A](task: => A): CancellableFuture[A]

Executes a task on this queue. You can use this to execute a piece of code on another dispatch queue than the one default to the parent code block, i.e.

Executes a task on this queue. You can use this to execute a piece of code on another dispatch queue than the one default to the parent code block, i.e.

... // running on Threading.defaultContext
UiDispatchQueue.Ui {
 ... // this will run on the UI thread
}
...
Type Params
A

the type of the task result

Value Params
task

an operation to perform on this queue.

Returns

a cancellable future which will finish with the result of the task

Inherited from
DispatchQueue

Deprecated and Inherited methods

@deprecated("preparation of ExecutionContexts will be removed", "2.12.0")
def prepare(): ExecutionContext
Deprecated
Inherited from
ExecutionContext

Concrete fields

override val name: String