{"id":19186866,"url":"https://github.com/dougeverly/futurevalue","last_synced_at":"2025-09-06T02:39:12.789Z","repository":{"id":29459669,"uuid":"32996111","full_name":"DougEverly/FutureValue","owner":"DougEverly","description":null,"archived":false,"fork":false,"pushed_at":"2015-07-09T22:49:25.000Z","size":144,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T03:25:31.863Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/DougEverly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-27T16:09:44.000Z","updated_at":"2015-03-27T16:17:47.000Z","dependencies_parsed_at":"2022-09-06T07:31:24.675Z","dependency_job_id":null,"html_url":"https://github.com/DougEverly/FutureValue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DougEverly/FutureValue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougEverly%2FFutureValue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougEverly%2FFutureValue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougEverly%2FFutureValue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougEverly%2FFutureValue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DougEverly","download_url":"https://codeload.github.com/DougEverly/FutureValue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougEverly%2FFutureValue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273849869,"owners_count":25179234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"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":[],"created_at":"2024-11-09T11:16:58.773Z","updated_at":"2025-09-06T02:39:12.749Z","avatar_url":"https://github.com/DougEverly.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FutureValue\n\nA threadsafe future implementation that blocks caller until a value is set.\n\n\n## Usage\n\n### Create a future value object\n\n    future = FutureValue.new\n    \n### Create a future value object with value\n\nIf the value is known at instantiation time, can pass the value. This is more efficient and will prevent blocking.\n\n    future = FutureValue.new(10)\n\n### Set a value\n\n    future.value = 10\n\nA RuntimeError will be raised if value is already set.\n\n    future.value = 10 unless future.has_value?\n\n  \n### Get a value (non-blocking)\n\n    until future.has_value?\n      sleep 1\n    end\n    value = future.value\n    \n### Get a value (blocking)\n\n    value = future.value\n\n## Example\n\n    require 'future_value'\n\n    f = FutureValue.new\n\n    t = Thread.new do\n      sleep 2\n      f.value = 4\n    end\n\n    if f.has_value?\n      puts \"yes\"\n    else\n      puts \"no\"\n    end\n\n    3.times do |i|\n      Thread.new do\n        puts \"Thread #{i} got #{f.value}\"\n      end\n    end\n\n    puts f.value\n\n    puts f.has_value?\n\n## Contributing\n\n1. Fork it ( https://github.com/DougEverly/future_value/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougeverly%2Ffuturevalue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdougeverly%2Ffuturevalue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougeverly%2Ffuturevalue/lists"}