Popularity
2.4
Declining
Activity
0.0
Stable
5
3
0
Programming language: Crystal
License: MIT License
Tags:
Misc
Latest version: v1.1.0
simple_retry alternatives and similar shards
Based on the "Misc" category.
Alternatively, view simple_retry alternatives based on common mentions on social networks and blogs.
-
sentry
Build/Runs your crystal application, watches files, and rebuilds/restarts app on file changes -
immutable
Thread-safe, persistent, immutable collections for the Crystal language -
crystagiri
An Html parser library for Crystal (like Nokogiri for Ruby) -
crz
Functional programming library for https://github.com/crystal-lang/crystal -
crystal-web-framework-stars
⭐️ Web frameworks for Crystal, most starred on Github -
cron_scheduler
Simple job scheduler with crontab patterns for Crystal Language. -
crystal-futures
Future type implementation for Crystal language -
inflector.cr
Inflector shard for Crystal. A port of ActiveSupport::Inflector -
aasm.cr
:arrows_clockwise: Easy to use finite state machine for Crystal classes -
kreal
Kreal is a model sharing & RPC library built on and works with Kemal seamlessly. -
retriable.cr
Retriable.cr is a simple DSL to retry failed code blocks -
ulid
Universally Unique Lexicographically Sortable Identifier (ULID) in Crystal -
CrSerializer
Extensible annotation based serialization/deserialization library -
circuit_breaker
Implementation of the circuit breaker pattern in crystal -
burocracia.cr
No dependency Crystal shard to validate, generate and format Brazilian burocracias such as CPF, CNPJ and CEP -
wikicr
Wiki in crystal, using Markdown and Git, inspired by dokuwiki. Last features to build are pretty hard, if you have some time to help... :) -
m3u8
Generate and parse m3u8 playlists for HTTP Live Streaming (HLS) in Crystal. -
message_verifier.cr
Rails compatible MessageVerifier for Crystal-lang apps
Access the most powerful time series database as a service
Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
Promo
www.influxdata.com
Do you think we are missing an alternative of simple_retry or a related project?
README
Simple Retry
A library for managing blocks of code that you might want to retry when an error occurs.
Installation
- Add the dependency to your
shard.yml
:
dependencies:
simple_retry:
github: spider-gazelle/simple_retry
- Run
shards install
Usage
require "simple_retry"
SimpleRetry.try_to do
# Something that should succeed eventually
num = rand(10)
raise "bad number #{num}" if num < 5
# Return the number
num
end
There are a number of options you can use to customise
require "simple_retry"
SimpleRetry.try_to(
# Runs the block at most 5 times
max_attempts: 5,
# Will always stop retrying on these errors
raise_on: DivisionByZeroError | ArgumentError,
# Will only retry on these errors
retry_on: Exception,
# Initial delay time after first retry
base_interval: 10.milliseconds,
# Exponentially increase delay up to this period
max_interval: 10.seconds,
# Adjust the exponential growth by a random amount
randomise: 10.milliseconds
) do |run_count : UInt64, last_error : Exception?, next_delay_time : Time::Span|
# Something that should succeed
end