timeout
Version, currently master branch1 version
- master branchlatestDec 13, 2016
github.com/hugoabonizio/timeout.cr
:hourglass_flowing_sand: Declarative timeout pattern for Crystal
10 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
timeout:
github: hugoabonizio/timeout.cr
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
- no constraint declared
- License
- MIT
- Author
- Hugo Abonizio <hugo_abonizio@hotmail.com>
Dependencies
This version declares no dependencies.
README
# Timeout.cr [](https://travis-ci.org/hugoabonizio/timeout.cr)
Declarative timeout pattern for Crystal using ```select``` keyword.
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
timeout:
github: hugoabonizio/timeout.cr
```
## Usage
```crystal
require "timeout"
ch = Channel(Int32).new
spawn do
sleep 2
ch.send 1
end
select
when value = ch.receive
puts "Done!"
when Timeout.after(1.second)
puts "Timeout!"
end
```
## Contributing
1. Fork it ( https://github.com/hugoabonizio/timeout.cr/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Contributors
- [hugoabonizio](https://github.com/hugoabonizio) Hugo Abonizio - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Dec 13, 2016
- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/hugoabonizio/timeout.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 1