Instance Method

requestOwnership(timeout:_:)

Requests ownership of the entity.

Declaration

func requestOwnership(timeout: TimeInterval = 15, _ callback: @escaping (SynchronizationComponent.OwnershipTransferCompletionResult) -> Void)

Parameters

timeout

A time in seconds to wait before giving up.

callback

A closure that the method calls when the request completes or times out.

Discussion

Requesting ownership isn’t guaranteed to succeed.

See Also

Synchronizing an Entity Among Peers

var synchronization: SynchronizationComponent?

The entity’s synchronization component.

struct SynchronizationComponent

A component that synchronizes an entity between processes and networked applications.

var isOwner: Bool

A Boolean that indicates whether the calling process owns the entity.

func withUnsynchronized(() -> Void)

Calls the given closure in a way such that component changes that the closure makes don’t trigger synchronization.

protocol HasSynchronization

An interface that enables an entity to be synchronized between processes and networked applications.