Skip to content

Queue Created Per Call (ARCH9040)

Key swift.async.queue-created-per-call · Severity warning · Category async

Flags DispatchQueue(label:) / OperationQueue() created inside a function body - a new queue (and thread) per call.

func save() { DispatchQueue(label: "io").async { } }
private let io = DispatchQueue(label: "io")

Create the queue once as a property and reuse it.