File tree 1 file changed +2
-1
lines changed
WorkflowConcurrency/Sources
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ public protocol Worker<Output>: AnyWorkflowConvertible where Rendering == Void {
30
30
associatedtype Output
31
31
32
32
/// Execute the work represented by this worker asynchronously and return the result.
33
+ /// This function will be run in a Task set to high priority.
33
34
func run( ) async -> Output
34
35
/// Returns `true` if the other worker should be considered equivalent to `self`. Equivalence should take into
35
36
/// account whatever data is meaningful to the task. For example, a worker that loads a user account from a server
@@ -63,7 +64,7 @@ struct WorkerWorkflow<WorkerType: Worker>: Workflow {
63
64
let sink = context. makeOutputSink ( )
64
65
context. runSideEffect ( key: state) { lifetime in
65
66
let send : @MainActor ( Output ) -> Void = sink. send
66
- let task = Task {
67
+ let task = Task ( priority : . high ) {
67
68
logger. logStarted ( )
68
69
let output = await worker. run ( )
69
70
if Task . isCancelled {
You can’t perform that action at this time.
0 commit comments