AmplifyInProcessReportingOperation
open class AmplifyInProcessReportingOperation<
Request: AmplifyOperationRequest,
InProcess,
Success,
Failure: AmplifyError
>: AmplifyOperation<Request, Success, Failure>, @unchecked Sendable
An AmplifyOperation that emits InProcess values intermittently during the operation.
Unlike a regular AmplifyOperation, which emits a single Result at the completion of the operation’s work, an
AmplifyInProcessReportingOperation may emit intermediate values while its work is ongoing. These values could be
incidental to the operation (such as a Storage.downloadFile operation reporting Progress values periodically as
the download proceeds), or they could be the primary delivery mechanism for an operation (such as a
GraphQLSubscriptionOperation‘s emitting new subscription values).
-
Declaration
Swift
public typealias InProcess = InProcess -
Declaration
Swift
public init( categoryType: CategoryType, eventName: HubPayloadEventName, request: Request, inProcessListener: InProcessListener? = nil, resultListener: ResultListener? = nil ) -
Classes that override this method must emit a completion to the
inProcessPublisherupon cancellationDeclaration
Swift
override open func cancel() -
Invokes
super.dispatch(). On iOS 13+, this method first publishes a.finishedcompletion on the in-process publisher.Declaration
Swift
override public func dispatch(result: OperationResult)Parameters
resultThe OperationResult to dispatch to the hub as part of the HubPayload
-
Convenience typealias for the
inProcessListenercallback submitted during Operation creationDeclaration
Swift
typealias InProcessListener = (InProcess) -> Void -
Dispatches an event to the hub. Internally, creates an
AmplifyOperationContextobject from the operation’sid, andrequestDeclaration
Swift
func dispatchInProcess(data: InProcess)Parameters
resultThe OperationResult to dispatch to the hub as part of the HubPayload
-
Removes the listener that was registered during operation instantiation
Declaration
Swift
func removeInProcessResultListener() -
Publishes in-process updates
Declaration
Swift
var inProcessPublisher: AnyPublisher<InProcess, Never> { get }
View on GitHub