Closed lucacorti closed 2 years ago
hi @lucacorti ,
currently we're sending options directly to HTTPoison client, so you can set a short timeout if needed https://github.com/inaka/Dayron/blob/master/lib/dayron/adapter.ex#L32.
Do you mean to provide something more specific, such as sending a message to the client to cancel the current request? If you have some example, it'll be appreciated :)
Hi @flaviogranero, thanks for taking the time to reply.
Short timeouts are nice to have, but I was thinking about circuit breaking logic to skip requests altogether in case the requested service is unavailable/unreachable. This allows the client to fail immediately on outages and is particularly helpful when you have to deal with multiple different services, especially when dealing with microservice environments.
Fuse is an Erlang implementation of this kind of behavior: https://github.com/jlouis/fuse
When dealing with external services an important part of the equation is circuit breaking logic to avoid long timeouts during outages or network congestion. Is anything like this already planned?