Is Combine Future's promise thread safe?

Do I need to protect against races when calling the promise that completes the Future?

Code Block swift
let future = Future<Int,Never> { promise in
savedPromise = promise
}
// later...
// in thread #1
savedPromise?(1)
// in thread #2
savedPromise?(2)


Answered by Engineer in 617446022
Yes, Future is thread safe.

Escaping parameters like that out of a block might result easily in leaks, but should still work.
Accepted Answer
Yes, Future is thread safe.

Escaping parameters like that out of a block might result easily in leaks, but should still work.

Hello,

Will Future be Sendable ?
Because it is an error in Swift 6 :
Non-sendable type 'Future<Bool, any Error>' exiting main actor-isolated context in call to non-isolated property 'value' cannot cross actor boundary

Thanks

Is Combine Future's promise thread safe?
 
 
Q