Structure_Concurrency5.9.0
UnownedJob
A unit of scheduleable work.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
@frozen struct UnownedJob
Unless you’re implementing a scheduler, you don’t generally interact with jobs directly.
An UnownedJob
must be eventually run exactly once using runSynchronously(on:)
. Not doing so is effectively going to leak and “hang” the work that the job represents (e.g. a Task
).
Citizens in _Concurrency
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
Members
init(ExecutorJob
) Create an
UnownedJob
whose lifetime must be managed carefully until it is run exactly once.init(Job
) Create an
UnownedJob
whose lifetime must be managed carefully until it is run exactly once.var description: String
var priority: JobPriority
The priority of this job.
func runSynchronously(on: UnownedSerialExecutor
) Run this job on the passed in executor.