next up previous
: Predictive Publications and Subscriptions : Colyseus Extensions to Mercury : Colyseus Extensions to Mercury

Soft-state Triggers

Colyseus introduces the notion of soft-state publications (also called triggers) to Mercury in addition to the soft-state subscriptions it already supports. A trigger is a publication with an associated TTL. It gets routed like a normal publication, except that it is also stored at the RP. When a new subscription is stored by the RP, it checks the stored triggers and sends those which match to the subscriber. Triggers are soft-state - the RP expires them (unless refreshed) after a specific amount of time which is specified in the trigger.

Triggers are used by Colyseus for two main purposes. First, objects in the game vary in terms of how often they change themselves. For example, some objects (e.g., items like health, etc.) do not change their co-ordinates very often and do not need to publish updates very frequently. In such cases, they can publish triggers with long TTLs which get stored at the respective RPs and are sent to the interested subscribers by the RP.

Second, triggers help in reducing object discovery time since the subscriber may not have to wait for the next object publication to arrive. While this may introduce staleness in the object update (since the trigger could be old), it also allows the publishing object to reduce its publishing rate. This enables a simple bandwidth-latency tradeoff.


next up previous
: Predictive Publications and Subscriptions : Colyseus Extensions to Mercury : Colyseus Extensions to Mercury
Ashwin Bharambe 平成17年3月2日