Add the following code to your project's shard.yml under:
dependencies
to use in production
- OR -
development_dependencies
to use in development
A VERY simple library for timing-out a potentially infinitely-running function call
Add the dependency to your shard.yml
:
dependencies:
timeout:
github: dscottboggs/timeout
Run shards install
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.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
).crystal tool format
and crystal spec
on the project.git push origin my-new-feature
)