@sigx/actors · v0.1.0

Actors

Virtual actors for SignalX — addressable, persistent server objects that ride the serverFn wire. Lazy activation, turn-based concurrency so a method body never races itself, pluggable storage with optimistic concurrency, durable reminders, and clustering across hosts when one machine stops being enough.

One activation per key

An actor is (type, key). actor(CartActor, 'user-42') always reaches the user-42 cart — the runtime finds it or activates it, and you never hold a reference or manage a lifetime.

Single-threaded, so no locks

One turn at a time per activation. Plain mutation on ctx.state is race-free by construction — no mutexes, no transactions, no compare-and-set loops in your code.

Persistent by default

ctx.save() writes through a pluggable ActorStorage with etag optimistic concurrency. A conflicting writer faults the stale activation instead of silently overwriting; the next call loads the winner.

Deadlocks throw, not hang

Every call carries its chain, so A → B → A raises ActorDeadlockError immediately with the full path — rather than blocking until some timeout fires in production at 3am.

Just a function call

Call an actor from a component, a server function or another actor with the same expression. The Vite plugin swaps actor modules for typed client stubs, so the browser gets a proxy and never the implementation.

One node until it isn't

Start with zero infrastructure. Add Redis, Postgres or Kubernetes membership when one process stops being enough — the actor code does not change, only the providers you hand the app.

Core
sigx
Router
@sigx/router
Store
@sigx/store
Use
@sigx/use