timeout
Timeout implementation for Crystal.
Installation
Add this to your application's shard.yml
:
dependencies:
timeout:
github: andrius/timeout
Usage
require "timeout"
Sample:
res = Timeout.timeout(0.1) do
puts "this line will be printed"
sleep 0.2
puts "this line won't be printed"
end
# will print false
puts "Result: #{res}"
Contributing
- Fork it ( https://github.com/ctiapps/timeout/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- andrius Andrius Kairiukstis - creator, maintainer