{"id":15954803,"url":"https://github.com/tembleking/event-driven-go","last_synced_at":"2025-04-04T06:43:35.015Z","repository":{"id":117580129,"uuid":"423770834","full_name":"tembleking/event-driven-go","owner":"tembleking","description":"POC of an event-driven Go implementation","archived":false,"fork":false,"pushed_at":"2021-11-02T11:37:38.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T18:14:27.762Z","etag":null,"topics":[],"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/tembleking.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-02T08:56:58.000Z","updated_at":"2021-11-02T11:37:40.000Z","dependencies_parsed_at":"2023-07-14T20:15:08.636Z","dependency_job_id":null,"html_url":"https://github.com/tembleking/event-driven-go","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/tembleking%2Fevent-driven-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tembleking%2Fevent-driven-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tembleking%2Fevent-driven-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tembleking%2Fevent-driven-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tembleking","download_url":"https://codeload.github.com/tembleking/event-driven-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135126,"owners_count":20889420,"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":[],"created_at":"2024-10-07T13:19:57.329Z","updated_at":"2025-04-04T06:43:34.985Z","avatar_url":"https://github.com/tembleking.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Event Driven example in Golang\n\nThis POC shows an example of event-driven architecture with a working domain event broker, an event producer and a\nconsumer.\n\nThe broker has a default buffer size of events of `3`, so if any of the consumers is not consuming the events fast\nenough, **the broker drops the events to protect himself**. In a production-level environment, these events would\ninstead be saved to an event repository.\n\nIf you execute this example, you should see the producer creating events every second, the consumer consuming the events\nevery 2 seconds, and therefore making the broker drop these events after a while.\n\nThe main executable can be turned off at any time with CTRL-C to send an Interrupt signal and proceed with the graceful\ntermination.\n\n## Execution\n\nYou can test this by executing the example with:\n\n```\n$ go run .\n2021/11/01 11:11:20 producer: I have produced something [produced=0]\n2021/11/01 11:11:21 producer: I have produced something [produced=1]\n2021/11/01 11:11:22 consumer: the producer created something [produced=0]\n2021/11/01 11:11:22 producer: I have produced something [produced=2]\n2021/11/01 11:11:23 producer: I have produced something [produced=3]\n2021/11/01 11:11:24 consumer: the producer created something [produced=1]\n2021/11/01 11:11:24 producer: I have produced something [produced=4]\n2021/11/01 11:11:25 producer: I have produced something [produced=5]\n2021/11/01 11:11:26 producer: I have produced something [produced=6]\n2021/11/01 11:11:26 consumer: the producer created something [produced=2]\n2021/11/01 11:11:26 broker: warning, event dropped [type=*producer.ProducedSomethingEvent, ID=605394647632969758, happenedOn=2021-11-02 11:11:26.956468166 +0100 CET m=+7.002266259]\n2021/11/01 11:11:27 producer: I have produced something [produced=7]\n2021/11/01 11:11:28 consumer: the producer created something [produced=3]\n2021/11/01 11:11:28 producer: I have produced something [produced=8]\n2021/11/01 11:11:29 quitting\n```\n\nOn signal interruption with graceful shutdown:\n\n```\n$ go run .\n2021/11/01 11:12:28 producer: I have produced something [produced=0]\n2021/11/01 11:12:29 producer: I have produced something [produced=1]\n2021/11/01 11:12:30 consumer: the producer created something [produced=0]\n2021/11/01 11:12:30 producer: I have produced something [produced=2]\n^C2021/11/01 11:12:30 cancelling from signal [signal=interrupt]\n2021/11/01 11:12:30 quitting\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftembleking%2Fevent-driven-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftembleking%2Fevent-driven-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftembleking%2Fevent-driven-go/lists"}