Method ReserveKeyAsync
ReserveKeyAsync(string, string, string, CancellationToken)
Reserves an idempotency key of a user for an upload that is about to be created, unless the key is reserved already.
Declaration
ValueTask<UploadKeyReservation> ReserveKeyAsync(string userId, string key, string uploadId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userId | The ID of the user. |
| string | key | The idempotency key, of 1 to 128 characters. |
| string | uploadId | The ID of the upload that is about to be created. |
| CancellationToken | cancellationToken | A token that cancels the operation. |
Returns
| Type | Description |
|---|---|
| ValueTask<UploadKeyReservation> | The key's reservation: for |
Remarks
A key stays reserved until it is released with ReleaseKeyAsync(string, string, string, CancellationToken) or the upload it is reserved for is deleted, which releases the key of its record (IdempotencyKey).