Thanks to visit codestin.com
Credit goes to github.com

Skip to content

lethalpaga/waiting

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Waiting

Waits so you don't have to!

Installation

Add this line to your application's Gemfile:

gem 'waiting'

And then execute:

$ bundle

Or install it yourself as:

$ gem install waiting

Usage

require 'waiting'

# optional
Waiting.default_max_attempts = max_attempts # defaults to 60
Waiting.default_interval = interval # seconds, defaults to 5

# will poll every interval max_attempts times until something returns true
Waiting.wait do |waiter|
  waiter.done if something
end

# You can also specify the max_attempts and interval this way
Waiting.wait(interval: interval, max_attempts: max_attempts) do |waiter|
  waiter.done if something
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/meringu/waiting.

About

Waits so you don't have to!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%