{"id":15321572,"url":"https://github.com/dipeshdulal/event-scheduling","last_synced_at":"2025-10-10T19:11:08.824Z","repository":{"id":51687441,"uuid":"330081136","full_name":"dipeshdulal/event-scheduling","owner":"dipeshdulal","description":"Golang Event Scheduling Sample Using Postgresql Database as persisting layer.","archived":false,"fork":false,"pushed_at":"2021-01-25T03:42:53.000Z","size":32,"stargazers_count":55,"open_issues_count":1,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T14:22:03.285Z","etag":null,"topics":["event-scheduler","go","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dipeshdulal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-16T04:08:38.000Z","updated_at":"2024-12-22T10:04:07.000Z","dependencies_parsed_at":"2022-08-03T00:01:26.119Z","dependency_job_id":null,"html_url":"https://github.com/dipeshdulal/event-scheduling","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipeshdulal%2Fevent-scheduling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipeshdulal%2Fevent-scheduling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipeshdulal%2Fevent-scheduling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipeshdulal%2Fevent-scheduling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dipeshdulal","download_url":"https://codeload.github.com/dipeshdulal/event-scheduling/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248995069,"owners_count":21195491,"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":["event-scheduler","go","postgresql"],"created_at":"2024-10-01T09:11:41.529Z","updated_at":"2025-10-10T19:11:03.807Z","avatar_url":"https://github.com/dipeshdulal.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Database Based Event Scheduling\n\nExample that demonstrates super basic database based event scheduling.\n\n\n#### To run this example; \n- Copy `.env.example` to `.env` and update postgres database dsn.\n- Run `go run .` \n\n\n**Basically,**\n - When we want to schedule a job, we add to database \n```go\nscheduler.Schedule(\"SendEmail\", \"mail: nilkantha.dipesh@gmail.com\", time.Now().Add(1*time.Minute)) \n```\n\n- Another go routine is always looking for jobs to execute (that has time expired) in the given interval.\n```go\nscheduler.CheckEventsInInterval(ctx, time.Minute)\n```\n\n**Output looks like;**\n```\n2021/01/16 11:58:49 💾 Seeding database with table...\n2021/01/16 11:58:49 🚀 Scheduling event SendEmail to run at 2021-01-16 11:59:49.344904505 +0545 +0545 m=+60.004623549\n2021/01/16 11:58:49 🚀 Scheduling event PayBills to run at 2021-01-16 12:00:49.34773798 +0545 +0545 m=+120.007457039\n2021/01/16 11:59:49 ⏰ Ticks Received...\n2021/01/16 11:59:49 📨 Sending email with data:  mail: nilkantha.dipesh@gmail.com\n2021/01/16 12:00:49 ⏰ Ticks Received...\n2021/01/16 12:01:49 ⏰ Ticks Received...\n2021/01/16 12:01:49 💲 Pay me a bill:  paybills: $4,000 bill\n2021/01/16 12:02:49 ⏰ Ticks Received...\n2021/01/16 12:03:49 ⏰ Ticks Received...\n^C2021/01/16 12:03:57 \n❌ Interrupt received closing...\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdipeshdulal%2Fevent-scheduling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdipeshdulal%2Fevent-scheduling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdipeshdulal%2Fevent-scheduling/lists"}