numberOfThreads

Returns the number of worker threads managed by this executor.

WebWorkerTaskExecutor.swift:479
iOS
18.0+
macOS
15.0+
tvOS
18.0+
visionOS
2.0+
watchOS
11.0+
var numberOfThreads: Int { get }

This property reflects the value provided during initialization and doesn’t change during the lifetime of the executor.

Example

let executor = try await WebWorkerTaskExecutor(numberOfThreads: 4)
print("Executor is running with \(executor.numberOfThreads) threads")
// Prints: "Executor is running with 4 threads"