Protocols
The following protocols are available globally.
-
Protocol for a Completable that can be used for cachable
See moreDeclaration
Swift
public protocol CachableCompletable : Completable
-
Protocol for objects that have cancellation
See moreDeclaration
Swift
public protocol Cancellable : AnyObject
-
A protocol for objects that can be manually completed
See moreDeclaration
Swift
public protocol Completable : Cancellable, CompletionController
-
A protocol for objects that can eventually complete with value
See moreDeclaration
Swift
public protocol Completing : CompletionController
-
A base protocol for objects that are aware of Success, Error and Completion
See moreDeclaration
Swift
public protocol CompletionController : LifetimeExtender
-
A base protocol of object that update and complete
See moreDeclaration
Swift
public protocol EventSource : Completing, EventController, Updating, Sequence
-
A base protocol of object aware of Update, Success, Error, Completion
See moreDeclaration
Swift
public protocol EventController : CompletionController, UpdatesController
-
A base protocol of object that can be updated and completed
See moreDeclaration
Swift
public protocol EventDestination : Completable, EventController, Updatable
-
Protocol for concurrency-aware active objects. Conforming to this protocol helps to avoid boilerplate code related to dispatching and memory management. See
Moving to nice asynchronous Swift code
for complete explanation.Best way to conform for model-related classes looks like:
public class MyService: ExecutionContext, ReleasePoolOwner { private let _internalQueue = DispatchQueue(label: "my-service-queue") public var executor: Executor { return .queue(_internalQueue) } public let releasePool = ReleasePool() /* class implementation */ }
Best way to conform for classes related to main queue looks like:
public class MyMainQueueService: ExecutionContext, ReleasePoolOwner { public var executor: Executor { return .main } public let releasePool = ReleasePool() /* class implementation */ }
Best way to conform for classes related to UI manipulations looks like:
public class MyPresenter: NSObject, ObjCUIInjectedExecutionContext { /* class implementation */ }
Classes that conform to NSResponder/UIResponder are automatically conformed to exection context.
See moreDeclaration
Swift
public protocol ExecutionContext : Retainer
-
Protocol for any instance that has
See moreReleasePool
. Made to proxy calls offunc releaseOnDeinit(_ object: AnyObject)
andfunc notifyDeinit(_ block: @escaping () -> Void)
toReleasePool
Declaration
Swift
public protocol ReleasePoolOwner : Retainer
-
An object that can extend lifetime of another objects up to deinit or notify deinit
See moreDeclaration
Swift
public protocol Retainer : AnyObject
-
Internal use only The combination of protocol _Fallible and enum Fallible is a dirty hack of type system. But there are no higher kinded types or generic protocols to implement it properly. Major propose is an ability to implement flatten() method.
See moreDeclaration
Swift
public protocol _Fallible : CustomStringConvertible
-
A base protocol for objects that are aware of Update
See moreDeclaration
Swift
public protocol UpdatesController : LifetimeExtender
-
A base protocol for objects that can provide Update values periodically
See moreDeclaration
Swift
public protocol Updating : UpdatesController
-
A base protocol for objects that can be updated with Update values
See moreDeclaration
Swift
public protocol Updatable : UpdatesController
-
Base protocol for objects that can extend lifetime of attached objects up to the moment of finalization (deinit or completion).
See moreDeclaration
Swift
public protocol LifetimeExtender : AnyObject
-
Context indepedent locking. Non-recursive.
See moreDeclaration
Swift
public protocol Locking : AnyObject
-
This protocol helps to hack type system in order to write where clauses for Optional’s wrapped type
See moreDeclaration
Swift
public protocol AsyncNinjaOptionalAdaptor : ExpressibleByNilLiteral
-
Convenience protocol for detection cancellation
See moreDeclaration
Swift
public protocol CancellationRepresentableError : Error
-
Is a protocol that automatically adds implementation of methods of
See moreExecutionContext
for Objective-C runtime compatible objects involved in UI manipulationsDeclaration
Swift
public protocol ObjCUIInjectedExecutionContext : ExecutionContext, ObjCInjectedRetainer