Skip to content

Commit 035e4dd

Browse files
refactor(WaitingRoomProvider): update tryPass method with MainActor and Task wrapper
- Add @mainactor annotation for thread safety - Change tryPass to be non-throwing and non-async - Wrap async call in Task for better concurrency handling
1 parent ebb1221 commit 035e4dd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/QueueITLib/WaitingRoomProvider.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ public final class WaitingRoomProvider {
4141
internetReachability = Reachability.reachabilityForInternetConnection()
4242
}
4343

44-
public func tryPass() async throws {
45-
try await tryEnqueue(enqueueToken: nil, enqueueKey: nil)
44+
@MainActor
45+
public func tryPass() {
46+
Task {
47+
try await tryEnqueue(enqueueToken: nil, enqueueKey: nil)
48+
}
4649
}
4750

4851
public func tryPassWithEnqueueToken(_ enqueueToken: String?) async throws {

0 commit comments

Comments
 (0)