timeout
timeout
A VERY simple library for timing-out a potentially infinitely-running function call
Installation
-
Add the dependency to your
shard.yml
:dependencies: timeout: github: dscottboggs/timeout
-
Run
shards install
Usage
require "timeout"
Timeout(String).try_for 1.second do
# some maybe long-running code
end
Unfortunately, for now you must specify the return-type of the block, due to a restriction in Crystal's type system.
Contributing
- Fork it (https://github.com/dscottboggs/timeout/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
). - Run
crystal tool format
andcrystal spec
on the project. - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- D. Scott Boggs - creator and maintainer
Repository
timeout
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- almost 5 years ago
- February 9, 2020
License
MIT License
Links
Synced at
Sat, 21 Dec 2024 13:29:37 GMT
Languages