-
Notifications
You must be signed in to change notification settings - Fork 0
Extensions to Ruby's Kernel that allow for retryable blocks of code.
chuyeow/try
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
= try
Extensions to Kernel that allow for retryable blocks of code.
== Examples
* Kernel#retryable
retryable(:tries => 3, :on => StandardError) do
# Some code that could fail, like connecting to a flakey API.
end
* Kernel#try
try(
some_method_that_could_fail,
Proc.new { raise RuntimeError unless moon.is_blue? },
'some fallback value if all things fail'
)About
Extensions to Ruby's Kernel that allow for retryable blocks of code.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published