{"id":16888438,"url":"https://github.com/imjasonh/delay","last_synced_at":"2025-09-02T17:09:41.937Z","repository":{"id":57560082,"uuid":"317525679","full_name":"imjasonh/delay","owner":"imjasonh","description":"Go package to make Cloud Tasks simpler for Cloud Run applications","archived":false,"fork":false,"pushed_at":"2024-04-10T02:49:13.000Z","size":76,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T10:12:01.245Z","etag":null,"topics":["async","cloud-run","cloud-tasks","golang"],"latest_commit_sha":null,"homepage":"","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/imjasonh.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":"2020-12-01T11:53:30.000Z","updated_at":"2024-04-10T02:49:16.000Z","dependencies_parsed_at":"2025-02-19T10:46:23.661Z","dependency_job_id":null,"html_url":"https://github.com/imjasonh/delay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imjasonh/delay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjasonh%2Fdelay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjasonh%2Fdelay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjasonh%2Fdelay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjasonh%2Fdelay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imjasonh","download_url":"https://codeload.github.com/imjasonh/delay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjasonh%2Fdelay/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266204534,"owners_count":23892364,"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","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":["async","cloud-run","cloud-tasks","golang"],"created_at":"2024-10-13T16:52:05.361Z","updated_at":"2025-07-20T21:33:25.794Z","avatar_url":"https://github.com/imjasonh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `delay`\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Image of relay race\" src=\"./relay.jpg\"\u003e\n\u003c/p\u003e\n\n**NOTE:** This is not an official Google project. It's an experimental\nderivative of the\n[`google.golang.org/appengine/delay`](https://google.golang.org/appengine/delay)\npackage. Where that package is intended for App Engine applications, this\npackage is intended to be used with Cloud Run.\n\n-----\n\n`delay` is a package that attempts to bring the simplicity of\n`google.golang.org/appengine/delay` to Cloud Run apps, to make it simpler to\nenqueue work to be handled later using Cloud Tasks.\n\n## Prerequisites\n\nYou must create the Task Queue yourself, which requires creating an App Engine\napplication. That application and region must match the region where the Cloud\nRun service is deployed.\n\n## Usage\n\nFirst, register your handler function. This must be done at init-time.\n\n```\nimport \"github.com/imjasonh/delay/\"\n\nvar laterFunc = delay.Func(myFunc)\n```\n\nYou can also use a function literal:\n\n```\nvar laterFunc = delay.Func(func(ctx context.Context, some, args string) error {\n\t...\n})\n```\n\nBefore calling the function you should also initialize the package:\n\n```\nfunc init() {\n\tdelay.Init()\n}\n```\n\nThen, to call the function, invoke its `Call` method.\n\n```\nerr := laterFunc.Call(ctx, req, queueName, \"arg1\", \"arg2\", \"arg3\")\n```\n\nEach time the function is invoked, a Cloud Task will be enqueued which will be\nhandled by the specified handler function.\n\nYou can also schedule invocation for a time in the future with\n`laterFunc.Delay`, specifying a duration to wait. This instructs the Cloud\nTasks queue to invoke the function at a time in the future.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjasonh%2Fdelay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimjasonh%2Fdelay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjasonh%2Fdelay/lists"}