{"id":19342290,"url":"https://github.com/matt-taylor/timeoutable","last_synced_at":"2026-06-12T06:32:10.977Z","repository":{"id":42365918,"uuid":"373395253","full_name":"matt-taylor/timeoutable","owner":"matt-taylor","description":"Extends how the base Timeout klass works. This gem adds the ability to customize the ability to send a warning signal to the working thread. This allows a potential graceful shutdown prior to violent death","archived":false,"fork":false,"pushed_at":"2022-04-08T18:14:20.000Z","size":1251,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-05T16:53:22.356Z","etag":null,"topics":["ruby","timeout"],"latest_commit_sha":null,"homepage":"https://github.com/matt-taylor/timeoutable","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matt-taylor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-03T05:48:48.000Z","updated_at":"2022-04-08T17:59:00.000Z","dependencies_parsed_at":"2022-09-12T11:00:57.996Z","dependency_job_id":null,"html_url":"https://github.com/matt-taylor/timeoutable","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/matt-taylor/timeoutable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-taylor%2Ftimeoutable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-taylor%2Ftimeoutable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-taylor%2Ftimeoutable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-taylor%2Ftimeoutable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matt-taylor","download_url":"https://codeload.github.com/matt-taylor/timeoutable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-taylor%2Ftimeoutable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34232790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby","timeout"],"created_at":"2024-11-10T03:34:24.642Z","updated_at":"2026-06-12T06:32:10.962Z","avatar_url":"https://github.com/matt-taylor.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Timeoutable\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'timeoutable', source: 'https://github.com/matt-taylor/timeoutable'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install timeoutable\n\n## Usage\n\nTake a looke at the [TestableKlass](https://github.com/matt-taylor/timeoutable/blob/main/lib/timeoutable/testable_klass.rb) for complete example.\n\n\n```ruby\nparams = {\n  warn: 10, # this can be a float\n  timeout: 15, # this can be a float\n  proc: -\u003e(thread, seconds_elapsed) { thread[BIT_NAME] = 1 }, # proc to call after ${warn} seconds -- passes the original thread and the seconds that have elapsed\n  message: \"Error message\",\n}\n\nTimeoutable.timeout(**params) do\n    # code wrapped in a timeout\nend\n```\n\n### How this works\nAfter `warn` seconds have elapsed, `Timoutable` will call the `proc`. In the example, the `proc` will set a bit in the thread. However, you can choose any method of communication to gracefully shutdown.\n\n## Development\n\nAfter checking out the repo, run `make bash` to install dependencies and build a container. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/matt-taylor/timeoutable. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/matt-taylor/timeoutable/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Timeoutable project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/matt-taylor/timeoutable/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatt-taylor%2Ftimeoutable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatt-taylor%2Ftimeoutable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatt-taylor%2Ftimeoutable/lists"}