Open ghost opened 3 years ago
Wouldn't it be easier to just do something like
int maxTries = 10;
int currentTry = 1;
START:
try
{
var res = DoSomeWork(number);
// etc...
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
if (++currentTry < maxTries)
{
goto START;
}
}
In the OB2 code, for example, I use the goto to loop until one of these conditions happen
If you give me a reason why this behaviour wouldn't be suitable, I will implement the feature that you asked for.
Thanks for responding. Of couse yes that would work but let's say the item you're processing is "banned" (because of some cooldowns for exemple) so you retry again and again but as the item is "banned" so it will never end with a good status. With this feature as the item is put at the end of the queue, while the other items are getting processed, the item that was put at the end of the queue is getting unbanned, so now reprocessing it will not give a bad status. I hope you understand what I mean
I'll see if I can find some time to do this, but I'm marking it as low priority for now since there are important performance issues to address first.
No problems, take your time. I wish I could help you but I'm not experienced enough in c# and don't understand fully the code.
Hello, First of all I have to say this library is very useful and works very well. I came across a problem, let's say I have the following code:
In this workFunction when the do DoSomeOtherWork throw an exception it will trigger TaskError event but the item is considered as "completed" and not put back in the queue so if I want to process it I would have to recreate a Parallelizer only with the failed items. this would be easier if there was possibility to put directly back in the queue when the workFunction got an unhandled exception. This feature could be possibly activated or deactivated by a simple parameter in the ctor.