safwank / ElixirRetry

Simple Elixir macros for linear retry, exponential backoff and wait with composable delays
Other
441 stars 32 forks source link

Fix bug in expiry/3 #46

Closed jtrees closed 2 years ago

jtrees commented 2 years ago

This fix changes expiry/3 in such a way that the expiry time is evaluated at runtime of the stream, rather than definition time. This grants greater flexibility and enables setting up a configured stream in advance (e.g. at compile time or in a gen_server init) and passing the stream around for use in various places, at various times.

See the added tests for an example.

Fixes #47

safwank commented 2 years ago

@jtrees Can you please fix the build issue before I merge the PR?

jtrees commented 2 years ago

Ah, yes. I'll check it out.

jtrees commented 2 years ago

Alright. Credo should be happy now.