Akka.NET Streams

230 Views Asked by At

How would you replay a web service request every ten seconds for ten times until it answers?

I've tried RecoverWithRetries and InitialDelay, but the first recovery immediately replays the web service call:

FromThirdOfContract().RecoverWithRetries(e =>
{
    return Source.FromTask(_third.GetThird(message.ContractIdLegacy)).InitialDelay(TimeSpan.FromSeconds(secondsbetween));
}, retry);

The first retry happens immediately instead of ten seconds later. In Akka, there's a RestartSource class; we don't have it in Akka.NET. Any ideas?

1

There are 1 best solutions below

0
On

I finally played with Source.Lazily() with my source. It's working, it's not evaluated before the initial delay call. But I'm listening for any other ideas