Skip to content
GitHub

ShardCallResult

type alias in meocord/core Since 4.1.0

type ShardCallResult<T> =
  | { shardIds: number[]; ok: true; value: T }
  | { shardIds: number[]; ok: false; error: string }

One process's answer to a ShardContext.call: the shards it runs, and the method's value or its error.

Check ok before reading value: a process that threw, lacked the service or did not answer in time gives ok: false with the error's message, and the other processes still answer.

See also