File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Sources/AsyncHTTPClient/AsyncAwait Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,7 @@ extension HTTPClient {
104
104
responseContinuation: continuation
105
105
)
106
106
107
- // `HTTPClient.Task` conflicts with Swift Concurrency Task and `Swift.Task` doesn't work
108
- _Concurrency. Task {
109
- await cancelHandler. registerTransaction ( transaction)
110
- }
107
+ cancelHandler. registerTransaction ( transaction)
111
108
112
109
self . poolManager. executeRequest ( transaction)
113
110
}
@@ -132,7 +129,7 @@ private actor TransactionCancelHandler {
132
129
133
130
init ( ) { }
134
131
135
- func registerTransaction ( _ transaction: Transaction ) {
132
+ private func _registerTransaction ( _ transaction: Transaction ) {
136
133
switch self . state {
137
134
case . initialised:
138
135
self . state = . register( transaction)
@@ -143,7 +140,13 @@ private actor TransactionCancelHandler {
143
140
}
144
141
}
145
142
146
- func _cancel( ) {
143
+ nonisolated func registerTransaction( _ transaction: Transaction ) {
144
+ Task {
145
+ await self . _registerTransaction ( transaction)
146
+ }
147
+ }
148
+
149
+ private func _cancel( ) {
147
150
switch self . state {
148
151
case . register( let bag) :
149
152
self . state = . cancelled
You can’t perform that action at this time.
0 commit comments