@telnyx/edge-runtime
v0.16.0
Published
Telnyx Edge Compute - Runtime SDK
Readme
@telnyx/edge-runtime
Runtime SDK for Telnyx Edge Compute.
Actor-to-actor calls (this.env)
Inside a StatefulActor, this.env carries one namespace per [[actors]]
binding declared in your telnyx.toml, so an actor can call another actor
(the substrate for agents spawning sub-agents):
class Concierge extends StatefulActor {
async delegate() {
// env.<BINDING>.idFromName(id).<method>(...args)
return this.env.ROLODEX.idFromName("shared").remember("caller", this.ctx.id);
}
}Calls go to the actor-invocation base URL — the local Dapr sidecar by default,
or the site actor router when EC_ACTOR_ROUTER_URL is set; the callee's turn
runs (and its state persists) exactly as a direct invocation would.
Self-call hazard (no re-entrancy). An actor is single-threaded per id — like a Cloudflare Durable Object. Calling your own id from inside a method (
this.env.<BINDING>.idFromName(this.ctx.id).m()) deadlocks: the nested call queues behind the turn you're already in, so it can't run until you return — and you can't return until it does. It rejects withActorMethodTimeoutErroronce the method wall-clock budget elapses. Calling a different id (even of the same type) is fine — the turn lock is per(type, id).
