Aller au contenu
Français

SingletonKeyedClass

Ce contenu n’est pas encore disponible dans votre langue.

SingletonKeyedClass<TCommand> = object

Defined in: src/cluster/singleton/SingletonKey.ts:73

A class that declares its own singleton identity as a static.

TypeScript’s implements clause constrains only the instance side of a class — there is no static implements, and abstract static is an error — so a SingletonActor marker interface could not carry this and would check nothing. A static field can, and it composes with any base class, which matters because a singleton is frequently also a PersistentActor and TypeScript has single inheritance. Enforcement happens where it counts: at the start() call site, which infers TCommand from this key and from the ActorClassOrFactory<TCommand> position simultaneously and reports a mismatch between them.

TCommand

readonly singleton: SingletonKey<TCommand>

Defined in: src/cluster/singleton/SingletonKey.ts:74