{"id":31042148,"url":"https://github.com/salihcantekin/space","last_synced_at":"2025-09-14T11:03:57.363Z","repository":{"id":313094304,"uuid":"1049982591","full_name":"salihcantekin/Space","owner":"salihcantekin","description":"High-performance, source-generator powered mediator and messaging framework for .NET.","archived":false,"fork":false,"pushed_at":"2025-09-11T09:58:22.000Z","size":205,"stargazers_count":81,"open_issues_count":12,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-11T12:42:14.729Z","etag":null,"topics":["dotnet","mediator","mediatr","messaging","sourcegenerator","space"],"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/salihcantekin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-03T19:22:53.000Z","updated_at":"2025-09-11T09:39:55.000Z","dependencies_parsed_at":"2025-09-03T22:22:20.056Z","dependency_job_id":"ccfdb1d3-1030-49fe-b3bf-37a296f51007","html_url":"https://github.com/salihcantekin/Space","commit_stats":null,"previous_names":["salihcantekin/space"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/salihcantekin/Space","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salihcantekin%2FSpace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salihcantekin%2FSpace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salihcantekin%2FSpace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salihcantekin%2FSpace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salihcantekin","download_url":"https://codeload.github.com/salihcantekin/Space/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salihcantekin%2FSpace/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275094385,"owners_count":25404448,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"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":["dotnet","mediator","mediatr","messaging","sourcegenerator","space"],"created_at":"2025-09-14T11:03:55.936Z","updated_at":"2025-09-14T11:03:57.354Z","avatar_url":"https://github.com/salihcantekin.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Space\n\nHigh-performance, source-generator powered mediator / messaging framework for .NET. Eliminates runtime reflection, minimizes boilerplate, and provides an extensible module + pipeline model for cross-cutting concerns (e.g., caching, auditing).\n\n---\n## Status \u0026 Packages\n\n| CI | Branch | Status |\n|----|--------|--------|\n| Prod (Stable Publish) | `master` | ![Prod CI](https://github.com/salihcantekin/Space/actions/workflows/prod-ci.yml/badge.svg) |\n| Dev (Preview Publish) | `dev` | ![Dev CI](https://github.com/salihcantekin/Space/actions/workflows/dev-ci.yml/badge.svg) |\n| Validation (PR / Feature) | PRs -\u003e `dev` / `master` | ![Validation Build](https://github.com/salihcantekin/Space/actions/workflows/validation-build.yml/badge.svg) |\n\n### NuGet Packages\n\n| Package | Stable | Preview | Downloads | Description |\n|---------|--------|---------|-----------|-------------|\n| Space.Abstraction | ![NuGet](https://img.shields.io/nuget/v/Space.Abstraction.svg) | ![NuGet (pre)](https://img.shields.io/nuget/vpre/Space.Abstraction.svg) | ![Downloads](https://img.shields.io/nuget/dt/Space.Abstraction.svg) | Core abstractions: attributes, contexts, contracts |\n| Space.DependencyInjection | ![NuGet](https://img.shields.io/nuget/v/Space.DependencyInjection.svg) | ![NuGet (pre)](https://img.shields.io/nuget/vpre/Space.DependencyInjection.svg) | ![Downloads](https://img.shields.io/nuget/dt/Space.DependencyInjection.svg) | DI extensions + source generator bootstrap |\n| Space.Modules.InMemoryCache | ![NuGet](https://img.shields.io/nuget/v/Space.Modules.InMemoryCache.svg) | ![NuGet (pre)](https://img.shields.io/nuget/vpre/Space.Modules.InMemoryCache.svg) | ![Downloads](https://img.shields.io/nuget/dt/Space.Modules.InMemoryCache.svg) | In-memory caching module + attribute integration |\n\n### Install (Minimal)\n```bash\ndotnet add package Space.Abstraction\ndotnet add package Space.DependencyInjection\n```\nOptional module:\n```bash\ndotnet add package Space.Modules.InMemoryCache\n```\n\n---\n## Quick Start\n```csharp\nusing Microsoft.Extensions.DependencyInjection;\n\nvar services = new ServiceCollection();\nservices.AddSpace(opt =\u003e\n{\n    opt.NotificationDispatchType = NotificationDispatchType.Parallel; // or Sequential\n});\nservices.AddSpaceInMemoryCache(); // if caching module needed\n\nvar provider = services.BuildServiceProvider();\nvar space = provider.GetRequiredService\u003cISpace\u003e();\n\npublic sealed record UserLoginRequest(string UserName);\n/*\nThe response type can be defined using IRequest\u003cT\u003e.\n*/\npublic sealed record UserLoginRequest(string UserName) : IRequest\u003cUserLoginResponse\u003e\npublic sealed record UserLoginResponse(bool Success);\n\npublic class UserHandlers\n{\n    [Handle]\n    public ValueTask\u003cUserLoginResponse\u003e Login(HandlerContext\u003cUserLoginRequest\u003e ctx)\n        =\u003e ValueTask.FromResult(new UserLoginResponse(true));\n}\n\n /*\n The same functionality can be implemented using the IHandler\u003cUserLoginRequest,  UserLoginResponse\u003e interface.\n The primary difference from the attribute-based approach is that the method name will be explicitly defined in the interface implementation.\n*/\n\npublic class UserHandlers : IHandler\u003cUserLoginRequest, UserLoginResponse\u003e\n{\n    public ValueTask\u003cUserLoginResponse\u003e Handle  (UserLoginRequest request, CancellationToken  cancellationToken)\n        =\u003e ValueTask.FromResult(new UserLoginResponse   (true));\n}\n\nvar response = await space.Send\u003cUserLoginResponse\u003e(new UserLoginRequest(\"demo\"));\n/*\nA more efficient solution can be achieved in the Send method by utilizing both the request and response types.\n*/\nvar response = await space.Send\u003cUserLoginRequest, UserLoginResponse\u003e(new UserLoginRequest(\"demo\"))\n```\n\n### Named Handlers\n```csharp\npublic class PricingHandlers\n{\n    [Handle(Name = \"Default\")] public ValueTask\u003cPriceResult\u003e GetDefault(HandlerContext\u003cPriceQuery\u003e ctx) =\u003e ...;\n    [Handle(Name = \"Discounted\")] public ValueTask\u003cPriceResult\u003e GetDiscounted(HandlerContext\u003cPriceQuery\u003e ctx) =\u003e ...;\n}\nvar discounted = await space.Send\u003cPriceResult\u003e(new PriceQuery(...), handlerName: \"Discounted\");\n```\n\n### Pipelines\n```csharp\npublic class LoggingPipeline\n{\n    [Pipeline(Order = 100)]\n    public async ValueTask\u003cTResponse\u003e Log\u003cTRequest, TResponse\u003e(PipelineContext\u003cTRequest\u003e ctx)\n    {\n        // pre-execution \n        var result = await ctx.Next(ctx);\n        // post-execution\n        return result;\n    }\n}\n```\n\n### Notifications\n```csharp\npublic sealed record UserLoggedIn(string UserName);\npublic class LoginNotifications\n{\n    [Notification]\n    public ValueTask Log(NotificationContext\u003cUserLoggedIn\u003e ctx) =\u003e ValueTask.CompletedTask;\n}\nawait space.Publish(new UserLoggedIn(\"demo\"));\n```\n\n### Caching Module Example\n```csharp\npublic class UserQueries\n{\n    [Handle]\n    [CacheModule(DurationSeconds = 60)]\n    public ValueTask\u003cUserProfile?\u003e GetUser(HandlerContext\u003cUserId\u003e ctx) =\u003e ...;\n}\n```\n`[CacheModule]` (from Space.Modules.InMemoryCache) inserts caching logic before user pipelines.\n\n---\n## Key Features\n- Zero runtime reflection for discovery (Roslyn source generator)\n- Minimal boilerplate: annotate methods directly with `[Handle]`, `[Pipeline]`, `[Notification]`\n- Named handlers (multiple strategies for same request/response)\n- Orderable pipelines + early system module execution\n- Extensible module model (e.g., cache) before user pipelines\n- High-performance async signatures (`ValueTask`)\n- Parallel or sequential notification dispatch\n- Multi-targeting (netstandard2.0 + modern .NET)\n\n---\n## Performance Philosophy\nSpace front-loads cost at build time to reduce runtime overhead:\n- Compile-time metadata (registrations, maps)\n- No reflection-based runtime scanning\n- Low allocation pathways (current \u0026 planned pooling)\n\nBenchmarks (planned) will compare against other mediator libraries.\n\n---\n## Documentation\nPrimary docs in `docs/`:\n\n| Topic | Link |\n|-------|------|\n| Project Overview | [ProjectDoc.en.md](docs/ProjectDoc.en.md) |\n| Handlers | [Handlers](docs/Handlers.md) |\n| Pipelines | [Pipelines](docs/Pipelines.md) |\n| Notifications | [Notifications](docs/Notifications.md) |\n| Modules | [Modules](docs/Modules.md) |\n| Developer Recommendations | [DeveloperRecommendations](docs/DeveloperRecommendations.md) |\n| Known Issues | [KnownIssues](docs/KnownIssues.md) |\n| Planned Improvements | [PlannedImprovements](docs/PlannedImprovements.md) |\n\nPer-package:\n- [Space.Abstraction](src/Space.Abstraction/README.md)\n- [Space.DependencyInjection](src/Space.DependencyInjection/README.md)\n\n---\n## Roadmap \u0026 Issues\nSee GitHub Issues for:\n- Planned improvements (attribute parameters, global defaults, Options pattern)\n- Known issues (initial Lazy `ISpace` null, module scoping on named handlers)\n\nContributions welcome via issues \u0026 PRs.\n\n---\n## Versioning \u0026 Releases\n- `master`: tagged semantic versions (`vX.Y.Z`) ? stable NuGet\n- `dev`: continuous preview (`X.Y.(Patch+1)-preview.\u003crun\u003e`)\n- Feature branches: validation build only\n\n---\n## License\nMIT.\n\n---\n## Disclaimer\nAPIs may evolve while early preview features stabilize. Track releases for changes.\n\n---\n# Space\n\nSpace is a high-performance, source-generator powered mediator/messaging framework for .NET.\n\n- Docs: see the `docs/` folder\n- Contribution guide for modules: see [docs/Contribution.md](docs/Contribution.md)\n\n## Quick links\n- Handlers: docs/Handlers.md\n- Pipelines: docs/Pipelines.md\n- Notifications: docs/Notifications.md\n- Known Issues: docs/KnownIssues.md\n- Developer Recommendations: docs/DeveloperRecommendations.md\n\n## Build\nSee `.github/copilot-instructions.md` for environment and common commands.\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalihcantekin%2Fspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalihcantekin%2Fspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalihcantekin%2Fspace/lists"}