Skip to content

Commit 74f039a

Browse files
committed
Make the termination handler Sendable
1 parent 56b1e20 commit 74f039a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/ProcessInvocation/ProcessInvocation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ public struct ProcessInvocation : AsyncSequence {
392392

393393
You retrieve the process and a dispatch group you can wait on to be notified when the process and all of its outputs are done.
394394
You can also set the termination handler of the process, but you should wait on the dispatch group to be sure all of the outputs have finished streaming. */
395-
public func invoke(outputHandler: @escaping (_ result: Result<RawLineWithSource, Error>, _ signalEndOfInterestForStream: () -> Void, _ process: Process) -> Void, terminationHandler: ((_ process: Process) -> Void)? = nil) throws -> (Process, DispatchGroup) {
395+
public func invoke(outputHandler: @escaping (_ result: Result<RawLineWithSource, Error>, _ signalEndOfInterestForStream: () -> Void, _ process: Process) -> Void, terminationHandler: (@Sendable (_ process: Process) -> Void)? = nil) throws -> (Process, DispatchGroup) {
396396
assert(!fileDescriptorsToSend.keys.contains(.standardInput), "Standard input must be modified using stdinRedirect")
397397
assert(!fileDescriptorsToSend.keys.contains(.standardOutput), "Standard output must be modified using stdoutRedirect")
398398
assert(!fileDescriptorsToSend.keys.contains(.standardError), "Standard error must be modified using stderrRedirect")

0 commit comments

Comments
 (0)