Define SubmitAsync Timeout

Post Reply
aordonez
Posts: 21
Joined: Wed Jun 05, 2019 11:40 am

Define SubmitAsync Timeout

Post 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
alt
Site Admin
Posts: 992
Joined: Tue Apr 25, 2006 9:45 am

Re: Define SubmitAsync Timeout

Post 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.
Post Reply