Page 1 of 1

Define SubmitAsync Timeout

Posted: Tue Dec 15, 2020 3:30 pm
by aordonez
Hi, I'm migrating to inetlab 2.8.6 in Net. Core and I need to define a Timeout when submit batch messages . In 2.6 version I used Submit method and await the task like this:

Code: Select all

 var task = _client.SubmitAsync(batch);
 if (await Task.WhenAny(task, Task.Delay(timeout)) == task)
{//OK
}else
{//TIMEOUT
}
But I can't do this with SubmitAsync.

Is There another way to define a timeout to interrupt the submit process

Re: Define SubmitAsync Timeout

Posted: Tue Dec 15, 2020 6:55 pm
by alt
There is no much difference in SubmitAsync method between 2.6 and 2.8. So it should work the same way.

What type is "batch" variable?

As far as I understood, you want the library to support CancelationToken parameter in SubmitAsync methods.