EdgeAIG's picture
download
raw
1.31 kB
/**
* Branded integer identifiers for cluster runners. A `MachineId` marks the
* machine component used by cluster services, especially snowflake id
* generation, while keeping the value distinct from an ordinary `number` in
* TypeScript APIs.
*
* @since 4.0.0
*/
import * as Schema from "../../Schema.js";
/**
* Schema for branded integer machine identifiers used by the cluster.
*
* @category constructors
* @since 4.0.0
*/
export const MachineId = /*#__PURE__*/Schema.Int.pipe(/*#__PURE__*/Schema.brand("~effect/cluster/MachineId"), /*#__PURE__*/Schema.annotate({
toFormatter: () => machineId => `MachineId(${machineId})`
}));
/**
* Brands a number as a `MachineId`.
*
* **When to use**
*
* Use to turn a trusted numeric machine id into the branded type when
* implementing runner storage adapters or configuring snowflake generation.
*
* **Details**
*
* The branded value is the original number at runtime.
*
* **Gotchas**
*
* `make` does not validate integer input or enforce the snowflake machine-id
* range. Snowflake ids encode the machine component modulo 1024.
*
* @see {@link MachineId} for the schema that validates branded integer machine identifiers
*
* @category constructors
* @since 4.0.0
*/
export const make = id => id;
//# sourceMappingURL=MachineId.js.map

Xet Storage Details

Size:
1.31 kB
·
Xet hash:
0a5ae2090af918bf04923c366ce7a4eeea7a4cb8ef9fc9433a3251d9e52e2728

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.