DispatchQueue

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply(concurrentTasks: Int, executor: ExecutionContext): DispatchQueue

Creates a dispatch queue with a generated name.

Creates a dispatch queue with a generated name.

Value Params
concurrentTasks
  • the maximum number of concurrent tasks the queue is allowed to run. Can be Unlimited, Serial, or an arbitrary positive number bigger than 1.
executor
  • the underlying execution context
Returns

a new dispatch queue, either unlimited, serial, or limited.

def apply(concurrentTasks: Int, executor: ExecutionContext, name: String): DispatchQueue

Creates a dispatch queue with a given name.

Creates a dispatch queue with a given name.

Value Params
concurrentTasks
  • the maximum number of concurrent tasks the queue is allowed to run. Can be Unlimited, Serial, or an arbitrary positive number bigger than 1.
executor
  • the underlying execution context
name
  • the name of the queue; might be later used e.g. in logging
Returns

a new dispatch queue, either unlimited, serial, or limited.

def apply(concurrentTasks: Int, service: ExecutorService): DispatchQueue

Creates a dispatch queue with a generated name, given an executor service instead of an execution context.

Creates a dispatch queue with a generated name, given an executor service instead of an execution context.

Value Params
concurrentTasks
  • the maximum number of concurrent tasks the queue is allowed to run. Can be Unlimited, Serial, or an arbitrary positive number bigger than 1.
service
  • the underlying executor service. The dispatch queue will create a new execution context, using the service.
Returns

a new dispatch queue, either unlimited, serial, or limited.

See also

java.util.concurrent.ExecutorService

def apply(concurrentTasks: Int, service: ExecutorService, name: String): DispatchQueue

Creates a dispatch queue with a given name, given an executor service instead of an execution context.

Creates a dispatch queue with a given name, given an executor service instead of an execution context.

Value Params
concurrentTasks
  • the maximum number of concurrent tasks the queue is allowed to run. Can be Unlimited, Serial, or an arbitrary positive number bigger than 1.
name
  • the name of the queue; might be later used e.g. in logging.
service
  • the underlying executor service. The dispatch queue will create a new execution context, using the service.
Returns

a new dispatch queue, either unlimited, serial, or limited.

See also

java.util.concurrent.ExecutorService

Concrete fields

final val Serial: Int

Used in place on the concurrentTasks parameter in one of the DispatchQueue.apply method, SERIAL indicates that the queue should be a serial one. But take a look on SerialDispatchQueue.apply before you decide to use it.

Used in place on the concurrentTasks parameter in one of the DispatchQueue.apply method, SERIAL indicates that the queue should be a serial one. But take a look on SerialDispatchQueue.apply before you decide to use it.

See also
final val Unlimited: Int

Used in place on the concurrentTasks parameter in one of the DispatchQueue.apply method, UNLIMITED indicates that the queue should be an unlimited one. But take a look on UnlimitedDispatchQueue.apply before you decide to use it.

Used in place on the concurrentTasks parameter in one of the DispatchQueue.apply method, UNLIMITED indicates that the queue should be an unlimited one. But take a look on UnlimitedDispatchQueue.apply before you decide to use it.

See also