Skip to content

Commit

Permalink
Fixing Issues with Async Upstream (#108)
Browse files Browse the repository at this point in the history
### Motivation

Fixing Issues with Building in Swift 6 for Linux

### Modifications

* Fix Issues with Upstream Iterator

### Result

Compatability with Swift 6 on Linux

### Test Plan

TBD
  • Loading branch information
leogdion authored Jul 2, 2024
1 parent acb1838 commit e80046b
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,17 @@ extension MultipartFramesToRawPartsSequence {
switch stateMachine.nextFromPartSequence() {
case .returnNil: return nil
case .fetchFrame:
let frame: Upstream.AsyncIterator.Element?
var upstream = upstream
let frame = try await upstream.next()
#if compiler(>=6.0)
if #available(macOS 15, iOS 18.0, tvOS 18.0, watchOS 11.0, macCatalyst 18.0, visionOS 2.0, *) {
frame = try await upstream.next(isolation: self)
} else {
frame = try await upstream.next()
}
#else
frame = try await upstream.next()
#endif
self.upstream = upstream
switch stateMachine.partReceivedFrame(frame) {
case .returnNil: return nil
Expand All @@ -365,8 +374,17 @@ extension MultipartFramesToRawPartsSequence {
switch stateMachine.nextFromBodySubsequence() {
case .returnNil: return nil
case .fetchFrame:
let frame: Upstream.AsyncIterator.Element?
var upstream = upstream
let frame = try await upstream.next()
#if compiler(>=6.0)
if #available(macOS 15, iOS 18.0, tvOS 18.0, watchOS 11.0, macCatalyst 18.0, visionOS 2.0, *) {
frame = try await upstream.next(isolation: self)
} else {
frame = try await upstream.next()
}
#else
frame = try await upstream.next()
#endif
self.upstream = upstream
switch stateMachine.bodyReceivedFrame(frame) {
case .returnNil: return nil
Expand Down

0 comments on commit e80046b

Please sign in to comment.