AdoptAsync
Methods
public Task<AdoptResult> AdoptAsync(CancellationToken cancellationToken = default)
Asynchronously requests authority over an orphaned entity.
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | Token that can be used to cancel the adoption request. |
Returns
| Type | Description |
|---|---|
| Task<AdoptResult> | A task that completes with the result of the adoption request. |
Remarks
This method is similar to RequestAuthorityAsync(AuthorityType, CancellationToken), but is used for entities that are orphaned.
Adoption requests require IsOrphaned to be true.
A request being processed doesn't guarantee that the adoption succeeds.
Requires a valid CoherenceBridge instance to process the adoption request.
Cancelling cancellationToken (or destroying the entity) completes the returned
task with Canceled. This only stops awaiting the result; it does not
recall an adoption request that has already been sent, so the entity may still end up adopted. The
request is only prevented from being sent if the token is already cancelled when this method is called.