Skip to content

Let users provide CancellationToken #300

@aeb-dev

Description

@aeb-dev

Is your feature request related to a problem? Please describe.

I created 100k streams to test the behavior of both the server and client. After I am done, I wanted to delete them with the client DeleteStream api. I used the following code:

foreach (var index in Enumerable.Range(1, 100_000))
{
    await ss.DeleteStream($"stream-{index}");
}

I got the following error:

System.TimeoutException: The operation has timed out.
         at RabbitMQ.Stream.Client.ManualResetValueTaskSource`1.System.Threading.Tasks.Sources.IValueTaskSource<T>.GetResult(Int16 token) in /_/RabbitMQ.Stream.Client/Client.cs:line 764
         at RabbitMQ.Stream.Client.Client.Request[TIn,TOut](Func`2 request, Nullable`1 timeout) in /_/RabbitMQ.Stream.Client/Client.cs:line 407
         at RabbitMQ.Stream.Client.Client.Request[TIn,TOut](Func`2 request, Nullable`1 timeout) in /_/RabbitMQ.Stream.Client/Client.cs:line 409
         at RabbitMQ.Stream.Client.Client.DeleteStream(String stream) in /_/RabbitMQ.Stream.Client/Client.cs:line 708
         at RabbitMQ.Stream.Client.StreamSystem.DeleteStream(String stream) in /_/RabbitMQ.Stream.Client/StreamSystem.cs:line 332

Describe the solution you'd like

My test probably is not something people will do but I think it is still valuable to have an option to provide CancellationToken

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestv2Version 2

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions