Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
/ gen_retry Public archive

Utilities for retrying Elixir functions, with configurable delay and backoff.

License

Notifications You must be signed in to change notification settings

appcues/gen_retry

Repository files navigation

GenRetry

Build Status Hex.pm Version

GenRetry provides utilities for retrying Elixir functions, with configurable delay and backoff characteristics.

Examples

my_background_function = fn ->
  :ok = try_to_send_tps_reports()
end
GenRetry.retry(my_background_function, retries: 10, delay: 10_000)
my_future_function = fn ->
  {:ok, val} = get_val_from_flaky_network_service()
  val
end
t = GenRetry.Task.async(my_future_function, retries: 3)
my_val = Task.await(t)  # may raise exception

Full gen_retry documentation is available on Hexdocs.pm.

Changelog and Contributors

CHANGELOG.md is a record of contributions and releases. Thanks so much to everyone who's submitted patches!

Authorship and License

GenRetry is copyright 2016-2021 Appcues, Inc.

GenRetry is released under the MIT License.

About

Utilities for retrying Elixir functions, with configurable delay and backoff.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages