{"id":20205954,"url":"https://github.com/sticksnleaves/greyhound","last_synced_at":"2025-07-14T04:36:27.477Z","repository":{"id":57503405,"uuid":"133955992","full_name":"sticksnleaves/greyhound","owner":"sticksnleaves","description":":bus:Extensible event bus platform","archived":false,"fork":false,"pushed_at":"2018-09-05T02:10:10.000Z","size":18,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-11T05:53:27.559Z","etag":null,"topics":["distributed","elixir","eventbus","extensible"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/sticksnleaves.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}},"created_at":"2018-05-18T13:10:18.000Z","updated_at":"2021-12-13T12:48:39.000Z","dependencies_parsed_at":"2022-09-13T08:22:16.299Z","dependency_job_id":null,"html_url":"https://github.com/sticksnleaves/greyhound","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sticksnleaves/greyhound","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sticksnleaves%2Fgreyhound","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sticksnleaves%2Fgreyhound/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sticksnleaves%2Fgreyhound/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sticksnleaves%2Fgreyhound/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sticksnleaves","download_url":"https://codeload.github.com/sticksnleaves/greyhound/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sticksnleaves%2Fgreyhound/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265241056,"owners_count":23733169,"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":["distributed","elixir","eventbus","extensible"],"created_at":"2024-11-14T05:20:17.664Z","updated_at":"2025-07-14T04:36:27.430Z","avatar_url":"https://github.com/sticksnleaves.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Greyhound\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:greyhound, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Define a bus\n\n```elixir\ndefmodule MyProject.Bus do\n  use Greyhound.Bus, otp_app: :my_project\nend\n```\n\n## Listener\n\n```elixir\ndefmodule MyProject.MyListener do\n  use GenServer\n\n  def start_link([]) do\n    GenServer.start_link(__MODULE__, %{}, name: __MODULE__)\n  end\n\n  def init(state) do\n    MyProject.Bus.subscribe(\"a_topic\")\n\n    {:ok, state}\n  end\n\n  def handle_info({:perform, topic, message}, state) do\n    IO.puts topic\n    IO.inspect message\n\n    {:noreply, state}\n  end\nend\n```\n\n## Dispatch Event\n\n```elixir\nMyProject.Bus.dispatch(\"a_topic\", \"a message\")\n\n# listener should print \"a_topic\" and \"a message\"\n```\n\n## Middleware\n\nAll dispatching logic is handled by middleware. Middleware can be customized by\noverriding the `__middleware__/0` function on a bus. The default middleware\ndispatches events sequentially to all listeners on the local node.\n\nhttps://github.com/sticksnleaves/greyhound/blob/master/lib/greyhound/middleware/dispatch/local.ex\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsticksnleaves%2Fgreyhound","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsticksnleaves%2Fgreyhound","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsticksnleaves%2Fgreyhound/lists"}