{"id":49273820,"url":"https://github.com/bethibande/actors","last_synced_at":"2026-04-25T15:04:51.994Z","repository":{"id":225507065,"uuid":"748695349","full_name":"Bethibande/actors","owner":"Bethibande","description":"Simple actor framework for kotlin","archived":false,"fork":false,"pushed_at":"2024-04-13T19:38:59.000Z","size":169,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"development","last_synced_at":"2024-04-14T00:37:51.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bethibande.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}},"created_at":"2024-01-26T15:06:58.000Z","updated_at":"2024-04-20T12:38:30.324Z","dependencies_parsed_at":"2024-03-02T15:28:14.502Z","dependency_job_id":"94d234f1-0543-47f6-93e7-c252a25e4f54","html_url":"https://github.com/Bethibande/actors","commit_stats":null,"previous_names":["bethibande/actors"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bethibande/actors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bethibande%2Factors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bethibande%2Factors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bethibande%2Factors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bethibande%2Factors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bethibande","download_url":"https://codeload.github.com/Bethibande/actors/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bethibande%2Factors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32266010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-04-25T15:04:32.335Z","updated_at":"2026-04-25T15:04:51.988Z","avatar_url":"https://github.com/Bethibande.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Quality Gate Status](https://sonar.bethibande.com/api/project_badges/measure?project=actors\u0026metric=alert_status\u0026token=sqb_b82c46a46c368d896f0fae5f1475dd81767fb825)](https://sonar.bethibande.com/dashboard?id=actors)\n[![Coverage](https://sonar.bethibande.com/api/project_badges/measure?project=actors\u0026metric=coverage\u0026token=sqb_b82c46a46c368d896f0fae5f1475dd81767fb825)](https://sonar.bethibande.com/dashboard?id=actors)\n[![Reliability Rating](https://sonar.bethibande.com/api/project_badges/measure?project=actors\u0026metric=reliability_rating\u0026token=sqb_b82c46a46c368d896f0fae5f1475dd81767fb825)](https://sonar.bethibande.com/dashboard?id=actors)\n[![Security Rating](https://sonar.bethibande.com/api/project_badges/measure?project=actors\u0026metric=security_rating\u0026token=sqb_b82c46a46c368d896f0fae5f1475dd81767fb825)](https://sonar.bethibande.com/dashboard?id=actors)\n[![Maintainability Rating](https://sonar.bethibande.com/api/project_badges/measure?project=actors\u0026metric=sqale_rating\u0026token=sqb_b82c46a46c368d896f0fae5f1475dd81767fb825)](https://sonar.bethibande.com/dashboard?id=actors)\n\n[![wakatime](https://wakatime.com/badge/user/72047d25-7643-4124-9850-1dd48ddf85f0/project/018d4022-e313-4df5-8fc4-262be0c59caf.svg)](https://wakatime.com/badge/user/72047d25-7643-4124-9850-1dd48ddf85f0/project/018d4022-e313-4df5-8fc4-262be0c59caf)\n# Actors\nA simple actor based programming framework for kotlin.\nCurrently only compatible with kotlin jvm.\n\n\u003e [!WARNING]\n\u003e This project is still experimental and lacking in features.\n\u003e The implementation still needs some work and refactoring, especially the KSP processor.\n\u003e This framework is not ready for production use, there are no official maven releases yet!\n\n### Example (Experimental)\nPlease note, this API is still experimental.\n\n[PersonState.kt](example/src/main/kotlin/com/bethibande/example/person/PersonState.kt)\n```kotlin\nimport com.bethibande.actors.annotations.ActorState\n\n/**\n * An actor implementation will be generated from this class.\n */\n@ActorState\ndata class PersonState(\n    var name: String,\n    var age: Int,\n)\n```\n[Main.kt](example/src/main/kotlin/com/bethibande/example/Main.kt), usage of the generated code\n```kotlin\nrunBlocking {\n    // Create actor-system\n    val system = Person.localActorSystem()\n    // Create a new actor\n    val person: Person = system.new(PersonState(\"Max\", 17))\n\n    // Use the actor\n    println(\"${person.getName()}: ${person.getAge()}\")\n    person.setAge(18)\n    println(\"${person.getName()}: ${person.getAge()}\")\n\n    // Custom behavior/command (see com.bethibande.example.person.CustomFunctionality.kt)\n    val (name, age) = person.getNameAndAge()\n    println(\"Custom: $name, $age\")\n\n    // Send close command\n    person.close()\n}\n```\n[CustomFunctionality.kt](example/src/main/kotlin/com/bethibande/example/person/CustomFunctionality.kt), adds custom functionallity / commands to the generated actor\n```kotlin\nimport com.bethibande.actors.Actor\nimport com.bethibande.actors.behavior.Behavior\nimport com.bethibande.example.person.command.PersonCommand\nimport kotlinx.coroutines.CompletableDeferred\n\ndata class PersonCommandGetNameAndAge(\n    val deferred: CompletableDeferred\u003cPair\u003cString, Int\u003e\u003e\n): PersonCommand {\n    companion object: Behavior\u003cPersonCommandGetNameAndAge, PersonState\u003e {\n        init {\n            // Adds the behavior to all actors of the Person type, also affects existing actors.\n            Person.BehaviorMap.add(PersonCommandGetNameAndAge::class.java, this)\n        }\n\n        override suspend fun accept(\n            command: PersonCommandGetNameAndAge,\n            state: PersonState,\n            actor: Actor\u003cPersonCommandGetNameAndAge, PersonState\u003e\n        ) {\n            command.deferred.complete(state.name to state.age)\n        }\n    }\n}\n\nsuspend fun Person.getNameAndAge(): Pair\u003cString, Int\u003e {\n    val deferred = CompletableDeferred\u003cPair\u003cString, Int\u003e\u003e()\n    send(PersonCommandGetNameAndAge(deferred))\n    return deferred.await()\n}\n```\n\n### Dependencies\n- [Google KSP](https://github.com/google/ksp) for processing symbols like annotations\n- [Kotlinpoet](https://github.com/square/kotlinpoet) for generating kotlin source code\n- [Kotlinx Coroutines](https://github.com/Kotlin/kotlinx.coroutines) for asynchronous programming\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbethibande%2Factors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbethibande%2Factors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbethibande%2Factors/lists"}