goakt

module
v4.6.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: MIT

README

GoAkt

build Go Reference codecov GitHub go.mod Go version Latest Release License Awesome Join our Slack

GoAkt is a distributed actor framework for Go, inspired by Erlang and Akka. In development since 2022 and used in production, it lets you build responsive, resilient, and elastic systems with typed actor messages, running as a single process or a cluster of nodes behind the same API.

  • Simpler concurrency. Actors process one message at a time; you write plain Go with no locks, channel plumbing, or shared-state bugs.
  • Location transparency. Send a message to a local, remote, or clustered actor with the same API; the framework handles the wire.
  • Resilience by design. Supervision trees and the "let it crash" model, inspired by Erlang/OTP, keep failures contained and recoverable.
  • Production batteries included. Clustering, virtual actors (grains), CRDTs, streams, scheduling, passivation, and observability, without re-rolling them yourself.

Teams use GoAkt for event processing, IoT and edge workloads, real-time platforms, and distributed backends that would otherwise need a message broker plus custom coordination code.

New to the actor model? Actors are isolated units of computation that share no memory, each with a mailbox, private state, and one message in flight at a time. On a message, an actor can create more actors, send messages, or change how it handles the next one. For more depth, watch Carl Hewitt, the father of the actor model, explain it in his own words:

Carl Hewitt on the actor model

See goakt.dev for an overview and the documentation for the full feature reference.

Installation

go get github.com/tochemey/goakt/v4

Examples

See the examples repository for runnable code covering local, remote, and clustered actor systems.

Benchmarks

The comparison benchmarks measure GoAkt against Ergo, Proto.Actor and Hollywood. Every framework runs the same thirteen scenarios under the same names: tell and ask, sequential and parallel; actor-to-actor ping-pong, from a single pair to pipelined pairs on every core; spawn and stop; the Savina ThreadRing, Fork Join and Big benchmarks; Skynet; and the live heap of an idle actor. The results are published with the hardware and versions they ran on, and a single make bench reproduces them on your machine.

Production

These systems run GoAkt in production:

  • Baki Money: AI-powered expense tracking platform that turns receipts into stories. Actors cache the app's data today, with wider use of the framework planned.
  • Analytics platform: a self-hosted analytics platform that collects behavioural and telemetry data across several product lines. It runs as one Go monolith on Kubernetes at about 31 pods, with GoAkt as the entire distribution layer: no message broker, no service mesh and no external actor registry. Inbound WebSocket and SSE connections are cluster-named actors, outbound integrations are single-activation grains, reporting fans out over messages, and cluster single-fire cron lets an external scheduler retire. In their words, "the actor core has not been a source of surprises". Read the full production report.

Being built on GoAkt:

  • V-App IoT Builder: a clustered Complex Event Processor that lets end users graphically design rules applied to incoming sensor data and react to environment changes.
  • Galaxy: a distributed real-time game platform. It uses clustered actors and grains for player state, matchmaking lobbies, game sessions, authoritative clocks, persistence and node relocation, with NATS JetStream for durable state, event logs and reliable WebSocket delivery.

Running GoAkt in production? Write a short report to be listed here, or tell us how it is going in the feedback discussion.

Security

Applications using this library should routinely upgrade their Go version and refresh dependencies as needed to mitigate security vulnerabilities. GoAkt will make a best effort to keep dependencies current and perform vulnerability checks whenever necessary. To report a vulnerability, use GitHub's Report a Vulnerability form, as described in SECURITY.md.

Community

Ask questions and follow the work in Discussions, Issues, or on Slack. Feedback on the tracking issue helps shape what we work on next.

Contribution

CLA

We welcome contributions: bug fixes, new features, and documentation improvements. Before diving in, read the architecture overview of GoAkt from the Inside, the maintainers' book, to understand the codebase. We use Conventional Commits and a Docker-backed Makefile so contributors only need Docker and Make installed; run make help to see the available targets.

See contributing.md for prerequisites, setup, and the full contribution workflow, the other design documents covering the dispatcher pool, CRDTs, streams, reentrancy, and reliable delivery, and the benchmark suite for the performance harness.

Sponsors

GoAkt is free and open source. If you need priority support on complex topics or want to fund new features, consider sponsorship.

Directories

Path Synopsis
selfmanaged
Package selfmanaged provides a self-managed discovery provider that allows cluster nodes to discover each other via UDP broadcast on the LAN—no third-party infrastructure or peer configuration required.
Package selfmanaged provides a self-managed discovery provider that allows cluster nodes to discover each other via UDP broadcast on the LAN—no third-party infrastructure or peer configuration required.
internal
address
Package address provides the canonical representation and utilities for addressing actors in a Go-Akt actor system.
Package address provides the canonical representation and utilities for addressing actors in a Go-Akt actor system.
id
net
pendingasks
Package pendingasks tracks callers that are blocked waiting for an asynchronous reply, keyed by the correlation ID carried on the request.
Package pendingasks tracks callers that are blocked waiting for an asynchronous reply, keyed by the correlation ID carried on the request.
refusal
Package refusal marks the error with which a node refused a grain message before any handler ran it, because the node is shutting down.
Package refusal marks the error with which a node refused a grain message before any handler ran it, because the node is shutting down.
retry
Package retry runs an operation until it succeeds, with exponential backoff between attempts.
Package retry runs an operation until it succeeds, with exponential backoff between attempts.
tlstest
Package tlstest loads the TLS fixtures the test suites share.
Package tlstest loads the TLS fixtures the test suites share.
mocks
playground
discussion-320 command
discussion-811 command
issue-1017 command
issue-1022 command
issue-1031 command
issue-1036 command
issue-1134 command
issue-1201 command
Reproduction for https://github.com/Tochemey/goakt/issues/1201
Reproduction for https://github.com/Tochemey/goakt/issues/1201
issue-1203 command
Reproduction for https://github.com/Tochemey/goakt/issues/1203
Reproduction for https://github.com/Tochemey/goakt/issues/1203
issue-1209 command
Reproduction for https://github.com/Tochemey/goakt/issues/1209
Reproduction for https://github.com/Tochemey/goakt/issues/1209
issue-1227 command
Reproduction for https://github.com/Tochemey/goakt/issues/1227
Reproduction for https://github.com/Tochemey/goakt/issues/1227
issue-1252 command
Package main reproduces github.com/Tochemey/goakt/issues/1252: the remoting server used to inherit cancelation from the Start context, so a bounded startup context expiring after startup poisoned every inbound handler context and all remote operations failed with "context deadline exceeded" until the process restarted.
Package main reproduces github.com/Tochemey/goakt/issues/1252: the remoting server used to inherit cancelation from the Start context, so a bounded startup context expiring after startup poisoned every inbound handler context and all remote operations failed with "context deadline exceeded" until the process restarted.
issue-1255 command
Relocation-at-scale regression harness for issue #1255.
Relocation-at-scale regression harness for issue #1255.
issue-1260 command
Package main is a Kubernetes reproduction for issue #1260: registry-derived crash recovery must be reliable on the default cluster configuration.
Package main is a Kubernetes reproduction for issue #1260: registry-derived crash recovery must be reliable on the default cluster configuration.
issue-1288 command
Package main is a living sample for github.com/Tochemey/goakt/issues/1288: grain timers.
Package main is a living sample for github.com/Tochemey/goakt/issues/1288: grain timers.
issue-1290 command
Package main is a living sample for github.com/Tochemey/goakt/issues/1290: grain request scheduling (reentrancy).
Package main is a living sample for github.com/Tochemey/goakt/issues/1290: grain request scheduling (reentrancy).
issue-1296 command
Package main is a living sample for github.com/Tochemey/goakt/issues/1296: point-to-point reliable delivery on a single node.
Package main is a living sample for github.com/Tochemey/goakt/issues/1296: point-to-point reliable delivery on a single node.
issue-1296/cluster command
Package main is the clustered companion of the issue-1296 sample: point-to-point reliable delivery between two actors hosted on different nodes of one GoAkt cluster.
Package main is the clustered companion of the issue-1296 sample: point-to-point reliable delivery between two actors hosted on different nodes of one GoAkt cluster.
issue-1301 command
Package main measures duplex remoting Tell throughput for github.com/Tochemey/goakt/issues/1301.
Package main measures duplex remoting Tell throughput for github.com/Tochemey/goakt/issues/1301.
issue-1312 command
Package main is a living sample for github.com/Tochemey/goakt/issues/1312: replies to stashed Asks were silently dropped after Unstash under concurrent load.
Package main is a living sample for github.com/Tochemey/goakt/issues/1312: replies to stashed Asks were silently dropped after Unstash under concurrent load.
issue-1315 command
Package main is a living sample for github.com/Tochemey/goakt/issues/1315: every spawned actor retained eager bookkeeping allocations it never used, and the spawn path allocated objects that were immediately discarded, which multiplied into a measurable heap floor and recurring GC cost at large resident populations.
Package main is a living sample for github.com/Tochemey/goakt/issues/1315: every spawned actor retained eager bookkeeping allocations it never used, and the spawn path allocated objects that were immediately discarded, which multiplied into a measurable heap floor and recurring GC cost at large resident populations.
issue-1317 command
Package main is a living sample for github.com/Tochemey/goakt/pull/1317: passivationHeap.Pop shrank the heap slice without clearing the popped slot, so the backing array kept a strong reference to every popped entry.
Package main is a living sample for github.com/Tochemey/goakt/pull/1317: passivationHeap.Pop shrank the heap slice without clearing the popped slot, so the backing array kept a strong reference to every popped entry.
issue-1322 command
Package main is a living sample for github.com/Tochemey/goakt/issues/1322.
Package main is a living sample for github.com/Tochemey/goakt/issues/1322.
issue-1331 command
issue-1334 command
issue-1340 command
Package main is a Docker Compose reproduction for issue #1340: a node that is killed abruptly must be reported as gone within seconds, and the work it hosted must come back on a survivor.
Package main is a Docker Compose reproduction for issue #1340: a node that is killed abruptly must be reported as gone within seconds, and the work it hosted must come back on a survivor.
issue-1374 command
Package main reproduces github.com/Tochemey/goakt/issues/1374: a wildcard bind address (0.0.0.0 or ::) used to make the remoting server listen on one guessed private IP instead of every interface, so connections through loopback were refused, a host with no private or public address could not start, and :: was advertised verbatim.
Package main reproduces github.com/Tochemey/goakt/issues/1374: a wildcard bind address (0.0.0.0 or ::) used to make the remoting server listen on one guessed private IP instead of every interface, so connections through loopback were refused, a host with no private or public address could not start, and :: was advertised verbatim.
issue-1377 command
Package main reproduces github.com/Tochemey/goakt/issues/1377: concurrent SpawnOn calls with the same name on two cluster nodes can both succeed and leave two live actors, because the cluster-wide duplicate check (checkSpawnPreconditions -> ActorExists) and the registry write (PutActor, last writer wins) are two separate steps.
Package main reproduces github.com/Tochemey/goakt/issues/1377: concurrent SpawnOn calls with the same name on two cluster nodes can both succeed and leave two live actors, because the cluster-wide duplicate check (checkSpawnPreconditions -> ActorExists) and the registry write (PutActor, last writer wins) are two separate steps.
issue-1386 command
Package main reproduces github.com/Tochemey/goakt/issues/1386: a named actor spawned with WithRelocationDisabled keeps its cluster registry record after the node hosting it is killed, so the dead incarnation still owns the name once membership has dropped the node.
Package main reproduces github.com/Tochemey/goakt/issues/1386: a named actor spawned with WithRelocationDisabled keeps its cluster registry record after the node hosting it is killed, so the dead incarnation still owns the name once membership has dropped the node.
issue-1391 command
Package main demonstrates the fix for github.com/Tochemey/goakt/issues/1391: recovering named non-relocatable actors after their owner node dies abruptly, with the recovery flow the reporter runs in production, while the cluster converges.
Package main demonstrates the fix for github.com/Tochemey/goakt/issues/1391: recovering named non-relocatable actors after their owner node dies abruptly, with the recovery flow the reporter runs in production, while the cluster converges.
issue-1396 command
Package main reproduces github.com/Tochemey/goakt/issues/1396: a grain activated on a node that is shutting down leaves a registry record that points at that node after it is gone, and the grain can no longer be reached.
Package main reproduces github.com/Tochemey/goakt/issues/1396: a grain activated on a node that is shutting down leaves a registry record that points at that node after it is gone, and the grain can no longer be reached.
issue-1397 command
issue-1400 command
Reproduction for https://github.com/Tochemey/goakt/issues/1400
Reproduction for https://github.com/Tochemey/goakt/issues/1400
issue-1402 command
Reproduction for https://github.com/Tochemey/goakt/issues/1402
Reproduction for https://github.com/Tochemey/goakt/issues/1402
issue-1403 command
Reproduction for https://github.com/Tochemey/goakt/issues/1403
Reproduction for https://github.com/Tochemey/goakt/issues/1403
issue-1405 command
issue-1407 command
Reproduction for https://github.com/Tochemey/goakt/issues/1407
Reproduction for https://github.com/Tochemey/goakt/issues/1407
issue-1408 command
Sample for https://github.com/Tochemey/goakt/issues/1408
Sample for https://github.com/Tochemey/goakt/issues/1408
issue-1409 command
Reproduction for https://github.com/Tochemey/goakt/issues/1409
Reproduction for https://github.com/Tochemey/goakt/issues/1409
issue-1411 command
Reproduction for https://github.com/Tochemey/goakt/issues/1411
Reproduction for https://github.com/Tochemey/goakt/issues/1411
issue-1413 command
Package main reproduces github.com/Tochemey/goakt/issues/1413 and a second defect of the same crash recovery that the investigation turned up.
Package main reproduces github.com/Tochemey/goakt/issues/1413 and a second defect of the same crash recovery that the investigation turned up.
issue-1415 command
Package main reproduces github.com/Tochemey/goakt/issues/1415 and a second defect of the same shutdown that the investigation turned up.
Package main reproduces github.com/Tochemey/goakt/issues/1415 and a second defect of the same shutdown that the investigation turned up.
issue-1422 command
issue-1423 command
issue-1430 command
Reproduction for https://github.com/Tochemey/goakt/issues/1430, the actor counterpart of https://github.com/Tochemey/goakt/issues/1407
Reproduction for https://github.com/Tochemey/goakt/issues/1430, the actor counterpart of https://github.com/Tochemey/goakt/issues/1407
issue-1434 command
Reproduction for https://github.com/Tochemey/goakt/issues/1434
Reproduction for https://github.com/Tochemey/goakt/issues/1434
issue-1435 command
Load test for https://github.com/Tochemey/goakt/issues/1435
Load test for https://github.com/Tochemey/goakt/issues/1435
issue-1437 command
Reproduction for https://github.com/Tochemey/goakt/issues/1437
Reproduction for https://github.com/Tochemey/goakt/issues/1437
issue-1444 command
Reproduction for https://github.com/Tochemey/goakt/issues/1444
Reproduction for https://github.com/Tochemey/goakt/issues/1444
issue-1448 command
Reproduction for https://github.com/Tochemey/goakt/issues/1448
Reproduction for https://github.com/Tochemey/goakt/issues/1448
issue-1453 command
issue-1456 command
Reproduction for https://github.com/Tochemey/goakt/issues/1456
Reproduction for https://github.com/Tochemey/goakt/issues/1456
issue-778 command
issue-779 command
issue-788 command
issue-791 command
issue-847 command
issue-886 command
issue-906 command
issue-908 command
issue-914 command
issue-925 command
issue-957 command
issue-973 command
issue-x command
Package stream provides reactive, backpressure-aware stream processing built on top of the GoAkt actor model.
Package stream provides reactive, backpressure-aware stream processing built on top of the GoAkt actor model.
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL