Home Reference Source Repository
import DispatchQueue from 'jscenekit/js/Dispatch/DispatchQueue.js'
public class | source

DispatchQueue

Extends:

DispatchObject → DispatchQueue

DispatchQueue manages the execution of work items. Each work item submitted to a queue is processed on a pool of threads managed by the system.

See:

Static Member Summary

Static Public Members
public static get

Static Method Summary

Static Public Methods
public static

concurrentPerformExecute(iterations: number, work: function(arg1: number): void): void

public static

global(priority: DispatchQueue.GlobalQueuePriority): DispatchQueue

this method was deprecated.

Constructor Summary

Public Constructor
public

constructor(label: string, qos: DispatchQoS, attributes: DispatchQueue.Attributes, autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency, target: DispatchQueue)

Member Summary

Public Members
public get
public get

qos: DispatchQoS

Method Summary

Public Methods
public

asyncAfter(deadline: DispatchTime, execute: DispatchWorkItem): void

public

asyncAfterExecute(deadline: DispatchTime, qos: DispatchQoS, flags: DispatchWorkItemFlags, work: function(): void): void

public

asyncExecute(workItem: DispatchWorkItem): void

public

getSpecific(key: DispatchSpecificKey<T>): T

public

init__label(label: UnsafePointer<Int8>, attr: __OS_dispatch_queue_attr): void

Blocks submitted to a serial queue are executed one at a time in FIFO order.

public

init__labelQueue(label: UnsafePointer<Int8>, attr: __OS_dispatch_queue_attr, target: DispatchQueue): void

public

setSpecific(key: DispatchSpecificKey<T>, value: T): void

public

sync(flags: DispatchWorkItemFlags): void

public

syncExecute(workItem: DispatchWorkItem): void

Inherited Summary

From class DispatchObject
public

activate(): void

Once a dispatch object has been activated, it cannot change its target queue.

public

resume(): void

Calling this function decrements the suspension count of a suspended dispatch queue or dispatch event source object.

public

setTarget(queue: DispatchQueue): void

An object's target queue is responsible for processing the object. The target queue determines the queue on which the object's finalizer is invoked.

public

suspend(): void

By suspending a dispatch object, your application can temporarily prevent the execution of any blocks associated with that object.

Static Public Members

Static Public Methods

public static concurrentPerformExecute(iterations: number, work: function(arg1: number): void): void source

Params:

NameTypeAttributeDescription
iterations number
work function(arg1: number): void

Return:

void

See:

public static global(priority: DispatchQueue.GlobalQueuePriority): DispatchQueue source

this method was deprecated.

Params:

NameTypeAttributeDescription
priority DispatchQueue.GlobalQueuePriority

Return:

DispatchQueue

See:

Public Constructors

public constructor(label: string, qos: DispatchQoS, attributes: DispatchQueue.Attributes, autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency, target: DispatchQueue) source

constructor

Override:

DispatchObject#constructor

Params:

NameTypeAttributeDescription
label string
qos DispatchQoS
attributes DispatchQueue.Attributes
autoreleaseFrequency DispatchQueue.AutoreleaseFrequency
target DispatchQueue
  • nullable: true

See:

Public Members

Public Methods

public asyncAfter(deadline: DispatchTime, execute: DispatchWorkItem): void source

Params:

NameTypeAttributeDescription
deadline DispatchTime
execute DispatchWorkItem

Return:

void

See:

public asyncAfterExecute(deadline: DispatchTime, qos: DispatchQoS, flags: DispatchWorkItemFlags, work: function(): void): void source

Params:

NameTypeAttributeDescription
deadline DispatchTime
qos DispatchQoS
flags DispatchWorkItemFlags
work function(): void

Return:

void

See:

public asyncExecute(workItem: DispatchWorkItem): void source

Params:

NameTypeAttributeDescription
workItem DispatchWorkItem

Return:

void

See:

public getSpecific(key: DispatchSpecificKey<T>): T source

Params:

NameTypeAttributeDescription
key DispatchSpecificKey<T>

Return:

T (nullable: true)

See:

public init__label(label: UnsafePointer<Int8>, attr: __OS_dispatch_queue_attr): void source

Blocks submitted to a serial queue are executed one at a time in FIFO order. Note, however, that blocks submitted to independent queues may be executed concurrently with respect to each other. Blocks submitted to a concurrent queue are dequeued in FIFO order but may run concurrently if resources are available to do so.If your app isn’t using ARC, you should call dispatch_release on a dispatch queue when it’s no longer needed. Any pending blocks submitted to a queue hold a reference to that queue, so the queue is not deallocated until all pending blocks have completed.

Params:

NameTypeAttributeDescription
label UnsafePointer<Int8>
  • nullable: true

A string label to attach to the queue to uniquely identify it in debugging tools such as Instruments, sample, stackshots, and crash reports. Because applications, libraries, and frameworks can all create their own dispatch queues, a reverse-DNS naming style (com.example.myqueue) is recommended. This parameter is optional and can be NULL.

attr __OS_dispatch_queue_attr
  • nullable: true

In macOS 10.7 and later or iOS 4.3 and later, specify DISPATCH_QUEUE_SERIAL (or NULL) to create a serial queue or specify DISPATCH_QUEUE_CONCURRENT to create a concurrent queue. In earlier versions, you must specify NULL for this parameter.

Return:

void

See:

public init__labelQueue(label: UnsafePointer<Int8>, attr: __OS_dispatch_queue_attr, target: DispatchQueue): void source

Params:

NameTypeAttributeDescription
label UnsafePointer<Int8>
  • nullable: true
attr __OS_dispatch_queue_attr
  • nullable: true
target DispatchQueue
  • nullable: true

Return:

void

See:

public setSpecific(key: DispatchSpecificKey<T>, value: T): void source

Params:

NameTypeAttributeDescription
key DispatchSpecificKey<T>
value T

Return:

void

See:

public sync(flags: DispatchWorkItemFlags): void source

Params:

NameTypeAttributeDescription
flags DispatchWorkItemFlags

Return:

void

Throw:

Error

See:

public syncExecute(workItem: DispatchWorkItem): void source

Params:

NameTypeAttributeDescription
workItem DispatchWorkItem

Return:

void

See: