{"id":23007172,"url":"https://github.com/bgokden/gofuture","last_synced_at":"2025-08-14T03:31:30.826Z","repository":{"id":57540528,"uuid":"220769525","full_name":"bgokden/gofuture","owner":"bgokden","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-18T10:39:33.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T11:01:42.409Z","etag":null,"topics":["concurrency","concurrent-programming","future","futures","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgokden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-10T09:41:46.000Z","updated_at":"2023-05-13T19:27:31.000Z","dependencies_parsed_at":"2024-06-20T10:16:18.182Z","dependency_job_id":"032614dd-c4de-4cb2-bf02-6ac4d8cb4973","html_url":"https://github.com/bgokden/gofuture","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bgokden/gofuture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgokden%2Fgofuture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgokden%2Fgofuture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgokden%2Fgofuture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgokden%2Fgofuture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgokden","download_url":"https://codeload.github.com/bgokden/gofuture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgokden%2Fgofuture/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270357711,"owners_count":24570419,"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-08-14T02:00:10.309Z","response_time":75,"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":["concurrency","concurrent-programming","future","futures","golang"],"created_at":"2024-12-15T08:14:50.645Z","updated_at":"2025-08-14T03:31:30.554Z","avatar_url":"https://github.com/bgokden.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-future\n\nGo-future gives an implementation similar to Java/Scala Futures.\n\nAlthough there are many ways to handle this behaviour in Golang.\nThis library is useful for people who got used to Java/Scala Future implementation.\n\n\n#### Import:\n```golang\nimport gofuture \"github.com/bgokden/gofuture\"\n```\n\n#### Usage:\n\n```golang\nfuture := gofuture.FutureFunc(func() int {\n  time.Sleep(5 * time.Second)\n  return x * 10\n})\n// do something else here\n// get result when needed\nresult := future.Get()\n```\n\nAlso it is possible to use timeouts on Get\n```golang\nresult := future.GetWithTimeout(3 * time.Second)\n```\n\n#### Note:\nThis is a very basic implementation where only Get and GetWithTimeout functions are implemented.\n\nFuture Get returns an interface so type casting should be done by user.\n\nEvery future creates a channel but it is not closed so it is better allow garbage collection of Future after usage.\n\n\n\nJava Futures: https://docs.oracle.com/javase/8/docs/api/index.html?java/util/concurrent/Future.html\n\nScala Futures: https://docs.scala-lang.org/overviews/core/futures.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgokden%2Fgofuture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgokden%2Fgofuture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgokden%2Fgofuture/lists"}