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
Value members
Concrete methods
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
Inherited methods
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