Skip to main content Link Search Menu Expand Document (external link)

ShardId overview

Added in v1.0.0


Table of contents


constructors

make

Constructs a shard id from its numerical value. The shard id is currently built up by making the hash of the entity id, and then modulo the max amount of shards configured in ManagerConfig.

Signature

export declare function make(value: number): ShardId

Added in v1.0.0

models

ShardId (class)

A shard is a logical grouping of multiple entities. There could be thousands of entities in your system, so instead of managing every single entity id, the shard manager group them by shard id, and when they are assigned or moved around, we always move all the entities with the same shard id.

Signature

export declare class ShardId

Added in v1.0.0

toString (method)

Signature

toString()

Added in v1.0.0

ShardId (namespace)

Added in v1.0.0

Encoded (interface)

This is the shape that a shard id has over the wire.

Signature

export interface Encoded extends Schema.Schema.Encoded<typeof ShardId> {}

Added in v1.0.0

schema

schema

This is the schema for a ShardId.

Signature

export declare const schema: Schema.Schema<ShardId, ShardId.Encoded>

Added in v1.0.0

symbols

ShardIdTypeId

Signature

export declare const ShardIdTypeId: typeof ShardIdTypeId

Added in v1.0.0

ShardIdTypeId (type alias)

Signature

export type ShardIdTypeId = typeof ShardIdTypeId

Added in v1.0.0