{"id":20589098,"url":"https://github.com/alexander-scott/mediatorsharp","last_synced_at":"2026-05-27T21:31:57.965Z","repository":{"id":85999364,"uuid":"162612673","full_name":"alexander-scott/MediatorSharp","owner":"alexander-scott","description":"A basic implementation of the Mediator design pattern that is used to promote decoupling between different systems","archived":false,"fork":false,"pushed_at":"2019-05-11T18:22:40.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T13:30:55.491Z","etag":null,"topics":["csharp","mediator","mediator-pattern","net"],"latest_commit_sha":null,"homepage":"","language":"C#","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/alexander-scott.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":"2018-12-20T17:46:42.000Z","updated_at":"2019-06-14T12:04:29.000Z","dependencies_parsed_at":"2023-03-13T08:08:35.568Z","dependency_job_id":null,"html_url":"https://github.com/alexander-scott/MediatorSharp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexander-scott/MediatorSharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexander-scott%2FMediatorSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexander-scott%2FMediatorSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexander-scott%2FMediatorSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexander-scott%2FMediatorSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexander-scott","download_url":"https://codeload.github.com/alexander-scott/MediatorSharp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexander-scott%2FMediatorSharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33585203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["csharp","mediator","mediator-pattern","net"],"created_at":"2024-11-16T07:27:50.733Z","updated_at":"2026-05-27T21:31:57.948Z","avatar_url":"https://github.com/alexander-scott.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MediatorSharp\n\nA basic implementation of the Mediator design pattern that is used to promote decoupling between different systems, as described [here](https://sourcemaking.com/design_patterns/mediator).\n\n## Usage\n\nCreate an instance of the MessageService class when your application first starts. Then, when creating your systems, inject the MessageService instance as a dependency. Systems can then subscribe to a specific message type by providing a function callback and the message type:\n\n```csharp\n_messageService.Subscribe(ApplicationStarted, MessageType.ApplicationStarted);\n```\n\nTo send messages between systems you simply need to send an IMessage to the MessageService:\n\n```csharp\n _messageService.SendMessage(new EmptyMessage(MessageType.ApplicationStarted));\n```\n\nIn the callback function of a subscribed system, the IMessage can be cast into whatever data type your system requires:\n\n```csharp\nprivate void ReceiveStringMessage(IMessage obj)\n{\n    StringMessage msg = (StringMessage) obj;\n    Debug.Log(\"Receive message: \" + msg.String)\n}\n```\n\nAdditional message types can be constructing by defining more values in the MessageType enum and by also creating classes that inherit from IMessage.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexander-scott%2Fmediatorsharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexander-scott%2Fmediatorsharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexander-scott%2Fmediatorsharp/lists"}