diff --git a/ios/MullvadTypes/Promise.swift b/ios/MullvadTypes/Promise.swift index 88b697510aff..ab80c316954b 100644 --- a/ios/MullvadTypes/Promise.swift +++ b/ios/MullvadTypes/Promise.swift @@ -48,6 +48,10 @@ public final class Promise { } } +// This object can be used like an async semaphore with exactly 1 writer. It +// allows the waiter to wait to `receive()` from another operation +// asynchronously. It is important not to forget to call `send`, otherwise this +// operation will block indefinitely. public struct OneshotChannel { private var continuation: AsyncStream.Continuation? private var stream: AsyncStream