{"id":18594468,"url":"https://github.com/bauhausphp/message-handler","last_synced_at":"2025-11-02T03:30:34.207Z","repository":{"id":36979785,"uuid":"410397886","full_name":"bauhausphp/message-handler","owner":"bauhausphp","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-17T03:59:20.000Z","size":28,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-26T20:28:06.534Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/bauhausphp.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":"2021-09-25T22:49:55.000Z","updated_at":"2022-05-24T19:40:33.000Z","dependencies_parsed_at":"2024-12-26T20:28:06.446Z","dependency_job_id":"c9fdbecc-2ebd-4542-a46c-f41731cf74d7","html_url":"https://github.com/bauhausphp/message-handler","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.0714285714285714,"last_synced_commit":"c840bd45b94e6eb72f52be6cd15d42984a7e8500"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fmessage-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fmessage-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fmessage-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fmessage-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bauhausphp","download_url":"https://codeload.github.com/bauhausphp/message-handler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239376359,"owners_count":19628343,"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-11-07T01:15:40.853Z","updated_at":"2025-11-02T03:30:34.157Z","avatar_url":"https://github.com/bauhausphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status]](https://github.com/bauhausphp/message-bus/actions)\n[![Coverage]](https://coveralls.io/github/bauhausphp/message-bus?branch=main)\n\n[![Stable Version]](https://packagist.org/packages/bauhaus/message-bus)\n[![Downloads]](https://packagist.org/packages/bauhaus/message-bus)\n[![PHP Version]](composer.json)\n[![License]](LICENSE)\n\n[Build Status]: https://img.shields.io/github/workflow/status/bauhausphp/message-bus/CI?style=flat-square\n[Coverage]: https://img.shields.io/coveralls/github/bauhausphp/message-bus?style=flat-square\n[Stable Version]: https://img.shields.io/packagist/v/bauhaus/message-bus?style=flat-square\n[Downloads]: https://img.shields.io/packagist/dt/bauhaus/message-bus?style=flat-square\n[PHP Version]: https://img.shields.io/packagist/php-v/bauhaus/message-bus?style=flat-square\n[License]: https://img.shields.io/github/license/bauhausphp/message-bus?style=flat-square\n\n# Message Bus\n\n## Installing\n\n```\n$ composer require bauhaus/message-bus\n```\n\n# Getting Started\n\n```php\n\u003c?php\n\nuse Bauhaus\\MessageBus;\nuse Bauhaus\\MessageBusSettings;\n\nclass YourCommand {}\nclass YourCommandHandler\n{\n    public function __invoke(CommandA $command): void {}\n}\n\nclass YourQuery {}\nclass YourQueryResult {}\nclass YourQueryHandler\n{\n    public function __invoke(YourQuery $query): YourQueryResult\n    {\n        return new YourQueryResult();\n    }\n}\n\n$messageBus = MessageBus::build(\n    MessageBusSettings::new()\n        -\u003ewithPsrContainer(/* Pass here your favorite PSR container */)\n        -\u003ewithHandlers(\n            YourCommandAHandler::class,\n            YourQueryHandler::class,\n        );\n);\n\n$result = $messageBus-\u003edispatch(new YourCommand());\nis_null($result); // true\n\n$result = $messageBus-\u003edispatch(new YourCommand());\n$result instanceof YourQueryResult; // true\n```\n\n# Contributing\n\nOpen an issue: https://github.com/bauhausphp/message-bus/issues\nCode: https://github.com/bauhausphp/contributor-tool\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbauhausphp%2Fmessage-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbauhausphp%2Fmessage-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbauhausphp%2Fmessage-handler/lists"}