Protocols

The following protocols are available globally.

  • A generic interface describing a lock that can be acquired for synchronous (blocking) reading or writing.

    See more

    Declaration

    Swift

    public protocol Lock
  • Represents a specific registrant within a specific Registry.

    A Receipt is given when an item is registered, and is used to manage the lifetime of item in the registry.

    When the Receipt is deallocated, the associated registrant is automatically de-registered. You can also call deregister() to force removal of the item prior to deallocation of its Receipt.

    See more

    Declaration

    Swift

    public protocol Receipt: class
  • A generic interface describing a lock that can be acquired for synchronous (blocking) reading or potentially asynchronous writing.

    Because the write operations of a FastWriteLock may be (but are not guaranteed to be) performed asynchronously, unlike with the completely synchronous Lock protocol:

    • Write operations require an @escaping closure
    • A value cannot be returned from a write operation

    The underlying FastWriteLock implementation determines whether and when write operations are performed asynchronously.

    See more

    Declaration

    Swift

    public protocol FastWriteLock