Herlin
Herlin

Reputation: 373

CancellationTokens for ReadDocumentAsync

Is there any proper way of canceling a running task against CosmosDb?

I'm calling my API that uses CancellationToken, when receiving data from the DocumentClient there does not seem to be a way of utilizing the tokens in a proper way.

Upvotes: 1

Views: 72

Answers (1)

Nick Chapsas
Nick Chapsas

Reputation: 7200

Versions before 2.0.0 for Microsoft.Azure.DocumentDB.Core don't have support for CancellationToken on the ReadDocumentAsync.

However Microsoft.Azure.DocumentDB.Core 2.0.0 just got released and it does have support for CancellationToken for all it's CRUD operations.

Upvotes: 1

Related Questions