Skip to content

Commit ef3c52d

Browse files
committed
More accurate comment
1 parent 33ee3c8 commit ef3c52d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Sources/AsyncQueue/ActorQueue.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public final class ActorQueue<ActorType: Actor>: @unchecked Sendable {
6363
Task { @ActorQueueSynchronization in
6464
for await actorTask in taskStream {
6565
// In Swift 6, a `Task` enqueued from a global actor begins executing immediately on that global actor.
66-
// Since we're running on a global actor already, we can just dispatch a Task and get FIFO task execution.
67-
// In an ideal world, we wouldn't need a global actor and would isolate this `for await` loop on the `ActorType`.
68-
// However, there's no good way to do that just yet.
66+
// Since we're running on a global actor already, we can just dispatch a Task to get first-enqueued-first-start
67+
// task execution. In an ideal world, we wouldn't need a global actor and would isolate this `for await` loop on
68+
// the `ActorType`. However, there's no good way to do that just yet.
6969
Task {
7070
await actorTask.task(actorTask.executionContext)
7171
}

Sources/AsyncQueue/MainActorQueue.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ public final class MainActorQueue: Sendable {
3636

3737
Task { @MainActor in
3838
for await task in taskStream {
39-
// In Swift 6, a `Task` enqueued from a global actor begins executing immediately on that global actor.
40-
// Since we're running on the global main actor already, we can just dispatch a Task and get FIFO task execution.
39+
// In Swift 6, a `Task` enqueued from a global actor begins executing immediately on that global
40+
// actor. Since we're running on the global main actor already, we can just dispatch a Task to
41+
// get first-enqueued-first-start task execution.
4142
Task {
4243
await task()
4344
}

0 commit comments

Comments
 (0)