{"id":23588116,"url":"https://github.com/sonirico/thearte","last_synced_at":"2026-05-01T19:32:07.768Z","repository":{"id":56348660,"uuid":"312427057","full_name":"sonirico/thearte","owner":"sonirico","description":"actor model system in golang","archived":false,"fork":false,"pushed_at":"2020-11-13T00:11:16.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T14:32:38.346Z","etag":null,"topics":["actor","actor-framework","actor-model","actorsystem","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/sonirico.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}},"created_at":"2020-11-13T00:09:04.000Z","updated_at":"2021-09-09T21:31:45.000Z","dependencies_parsed_at":"2022-08-15T17:01:10.475Z","dependency_job_id":null,"html_url":"https://github.com/sonirico/thearte","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonirico%2Fthearte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonirico%2Fthearte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonirico%2Fthearte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonirico%2Fthearte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonirico","download_url":"https://codeload.github.com/sonirico/thearte/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239418547,"owners_count":19635203,"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":["actor","actor-framework","actor-model","actorsystem","go","golang"],"created_at":"2024-12-27T05:12:28.043Z","updated_at":"2025-11-03T17:30:24.270Z","avatar_url":"https://github.com/sonirico.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thearte\n\n**Thearte** (intelligently misspelled from 'theatre') is a lightweight, minimal implementation\nof the actor model system in golang. Now, depending upon your background, you may ask:\n\n- Why to embedded `redux` in golang?\n- Why to create an `event emitter` in golang with javascript already has?\n- Why an actor model when golang is CSP based? or\n- Why all this \"bunga bunga\" to do something that is relatively easy to create by\n  employing the built-in communication \u0026 synchronization primitives that go already\n  offers?\n  \nThere is no magic. The underlying mechanism are go channels. I did NOT code this\nbecause I think that using channels in a standard fashion tend to couple things together, but because complex\nUML diagrams of interdependent pieces, or let's say large codebases, do not get along\nwith go. When your code starts filling up with strategies, senders, adapters, factories, \nclients, interceptors... it starts to feel natural just keep small and compact and connect all these pieces together\nby leveraging, you guessed, channels. It's the same reason as using pub/sub systems to segregate\nbusiness domain logic into microservices, where logic is decoupled because it needs to be scaled. If\nthat same concept applied to the internals of such microservices, your code may look like this\nexample savaged from the `examples` folder.\n\n```golang\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/sonirico/thearte/pkg\"\n)\n\ntype pingActor struct {\n\tthearte.Actor\n}\n\nfunc newPingActor() *pingActor {\n\treturn \u0026pingActor{Actor: thearte.NewActor(\"pinger\")}\n}\n\nfunc (p *pingActor) Ping(ctx context.Context, a thearte.Action, emit thearte.Emitter) {\n\ttime.Sleep(time.Second)\n\temit(thearte.NewAction(\"ping\", nil))\n}\n\ntype pongActor struct {\n\tthearte.Actor\n}\n\nfunc newPongActor() *pongActor {\n\treturn \u0026pongActor{Actor: thearte.NewActor(\"ponger\")}\n}\n\nfunc (p *pongActor) Pong(ctx context.Context, a thearte.Action, emit thearte.Emitter) {\n\ttime.Sleep(time.Second)\n\temit(thearte.NewAction(\"pong\", nil))\n}\n\nfunc main() {\n\tdone := make(chan struct{})\n\tctx, cancel := context.WithCancel(context.Background())\n\tstage := thearte.NewStage()\n\tping := newPingActor()\n\tpong := newPongActor()\n\n\tping.When(\"pong\", ping.Ping)\n\tpong.When(\"ping\", pong.Pong)\n\n\tstage.Register(ping, pong)\n\tgo stage.Start(ctx)\n\n    // Start the mandanga\n\tstage.Dispatch(thearte.NewAction(\"ping\", nil))\n\n\tgo func() {\n\t\t\u003c-time.After(time.Second * 10)\n\t\tlog.Println(\"canceling\")\n\t\tcancel()\n\t\t\u003c-time.After(time.Second * 10)\n\t\tdone \u003c- struct{}{}\n\t}()\n\t\u003c- done\n}\n```\n\n## Disclaimer\n\nEither way, **this project is a prototype** so not yet ready to use in production. There\nis no code coverage nor intend to add it soon. Use it at your own risk, although we both\nknow you wouldn't use it ;P\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonirico%2Fthearte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonirico%2Fthearte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonirico%2Fthearte/lists"}