File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,20 +167,27 @@ public extension NextcloudKit {
167167 }
168168 }
169169
170+ /// Actor responsible for holding and controlling the lifecycle of a single `UploadRequest`.
171+ ///
172+ /// This actor serializes access to the currently active request and ensures safe
173+ /// cancellation or cleanup from any calling context. Only one request is stored
174+ /// at a time; setting a new one replaces the previous reference.
175+ ///
176+ /// Typical usage:
177+ /// - `set(_:)` from the request handler when a new upload task starts.
178+ /// - `cancel()` from outside when the upload must be interrupted.
179+ /// - `clear()` after completion or failure to release strong references.
170180 actor ActorRequest {
171181 private var request : UploadRequest ?
172182
173- // Set/replace the active request (called from requestHandler)
174183 func set( _ req: UploadRequest ? ) {
175184 self . request = req
176185 }
177186
178- // Cancel if present
179187 func cancel( ) {
180188 self . request? . cancel ( )
181189 }
182190
183- // Clear to break strong references when done
184191 func clear( ) {
185192 self . request = nil
186193 }
You can’t perform that action at this time.
0 commit comments