Global Functionpointfreeco.swift-concurrency-extras 1.3.1ConcurrencyExtras
withMainSerialExecutor(operation:)
Perform an operation on the main serial executor.
func withMainSerialExecutor(operation: () throws -> Void) rethrows
Parameters
- operation
An operation to be performed on the main serial executor.
A synchronous version of withMainSerialExecutor(operation:)
that can be used in XCTestCase.invokeTest
to ensure all async tests are performed serially:
class BaseTestCase: XCTestCase {
override func invokeTest() {
withMainSerialExecutor {
super.invokeTest()
}
}
}