DataTransaction
public protocol DataTransaction: class
An interface for an asynchronously-executing data transaction.
-
Causes the transaction to be executed. The transaction may be performed asynchronously. When complete, the
Resultis reported to theCallbackfunction.Unless the
cancel()function is called prior to completion, the transaction will remain in memory until theCallbackis executed.Declaration
Swift
func executeTransaction(completion: @escaping Callback)Parameters
completionA function that will be called upon completion of the transaction.
-
The metadata type returned along with a successful transaction.
Declaration
Swift
associatedtype MetadataType -
The result type passed to the transaction completion callback function.
Declaration
Swift
typealias Result = TransactionResult<ResponseDataType, MetadataType> -
The signature of the callback function passed to
executeTransaction().Declaration
Swift
typealias Callback = (Result) -> Void -
The data type returned by a successful transaction.
Declaration
Swift
associatedtype ResponseDataType -
Attempts to cancel the transaction prior to completion.
Declaration
Swift
func cancel()
View on GitHub
DataTransaction Protocol Reference