{"id":18046316,"url":"https://github.com/trendyol/kediatr","last_synced_at":"2025-05-16T13:05:25.957Z","repository":{"id":39632707,"uuid":"207607885","full_name":"Trendyol/kediatR","owner":"Trendyol","description":"Mediator implementation in Kotlin with native coroutine support","archived":false,"fork":false,"pushed_at":"2025-04-11T16:41:30.000Z","size":3739,"stargazers_count":203,"open_issues_count":6,"forks_count":27,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-04-11T17:44:57.512Z","etag":null,"topics":["coroutines","cqrs","cqs","inprocess-bus","koin","kotlin","mediator","mediator-pattern","quarkus","spring-boot"],"latest_commit_sha":null,"homepage":"https://trendyol.github.io/kediatR/","language":"Kotlin","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/Trendyol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2019-09-10T16:22:47.000Z","updated_at":"2025-04-04T03:42:29.000Z","dependencies_parsed_at":"2023-09-26T16:20:19.711Z","dependency_job_id":"61599c1a-2458-4683-8a6e-c9d29e95212b","html_url":"https://github.com/Trendyol/kediatR","commit_stats":{"total_commits":454,"total_committers":15,"mean_commits":"30.266666666666666","dds":0.5286343612334802,"last_synced_commit":"781de13e0762023c57a86dca2c636feb1854c82e"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trendyol%2FkediatR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trendyol%2FkediatR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trendyol%2FkediatR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trendyol%2FkediatR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Trendyol","download_url":"https://codeload.github.com/Trendyol/kediatR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248531159,"owners_count":21119710,"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":["coroutines","cqrs","cqs","inprocess-bus","koin","kotlin","mediator","mediator-pattern","quarkus","spring-boot"],"created_at":"2024-10-30T19:06:42.285Z","updated_at":"2025-04-12T07:22:33.667Z","avatar_url":"https://github.com/Trendyol.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# kediatR ![Release](https://img.shields.io/maven-central/v/com.trendyol/kediatr-core?label=latest-release\u0026color=blue) [![codecov](https://codecov.io/gh/trendyol/kediatr/branch/main/graph/badge.svg)](https://codecov.io/gh/trendyol/kediatr) [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/Trendyol/kediatR/badge)](https://scorecard.dev/viewer/?uri=github.com/Trendyol/kediatR)\n\n\u003cimg style=\"float: left\" alt=\"Humus! The kediatr mascot\" src=\"/humus.png\" alt=\"drawing\" width=\"80\"/\u003e\n\nMediator implementation in kotlin with native coroutine support. Supports Spring-Boot, Quarkus and Koin dependency\nproviders.\n\n\u003e [!TIP]\n\u003e \"kedi\" in Turkish means cat 🐱 and kediatR rhymes with the C# equivalent library [mediatR](https://github.com/jbogard/MediatR) :)\n\nDocumentation is available at [https://trendyol.github.io/kediatR/](https://trendyol.github.io/kediatR/)\n\n## Show me the code\n\n```kotlin\nclass PingCommand : Command // or\nclass PingQuery : Query\u003cString\u003e // or\nclass PingNotification : Notification\nclass PingCommandHandler : CommandHandler\u003cPingCommand\u003e {\n  override suspend fun handle(command: PingCommand) {\n    println(\"Pong!\")\n  }\n}\nclass PingQueryHandler : QueryHandler\u003cPingQuery, String\u003e {\n  override suspend fun handle(query: PingQuery): String {\n    return \"Pong!\"\n  }\n}\n\nclass PingNotificationHandler : NotificationHandler\u003cPingNotification\u003e {\n  override suspend fun handle(notification: PingNotification) {\n    println(\"Pong!\")\n  }\n}\n\nclass MeasurePipelineBehaviour : PipelineBehaviour {\n\n  override val order: Int = 0\n\n  override suspend fun \u003cTRequest, TResponse\u003e handle(\n    request: TRequest,\n    next: RequestHandlerDelegate\u003cTRequest, TResponse\u003e\n  ): TResponse {\n    val start = System.currentTimeMillis()\n    val response = next(request)\n    val end = System.currentTimeMillis()\n    println(\"Request ${request::class.simpleName} took ${end - start} ms\")\n    return response\n  }\n}\n\nval mediator = // create mediator instance in-memory or with dependency injection, take a look at the documentation\nmediator.send(PingCommand()) // 1..1\nmediator.send(PingQuery()) // 1..1\nmediator.publish(PingNotification()) // 0..N\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendyol%2Fkediatr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrendyol%2Fkediatr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendyol%2Fkediatr/lists"}