| /** | |
| * The `SingletonAddress` module models the runtime address assigned to a cluster | |
| * singleton registration. The address pairs the singleton `name` with the | |
| * `ShardId` selected from that name and its shard group, giving sharding one | |
| * stable value for registration events, equality, hashing, and local singleton | |
| * fiber tracking. | |
| * | |
| * @since 4.0.0 | |
| */ | |
| import * as Equal from "../../Equal.ts" | |
| import * as Hash from "../../Hash.ts" | |
| import * as Schema from "../../Schema.ts" | |
| import { ShardId } from "./ShardId.ts" | |
| const TypeId = "~effect/cluster/SingletonAddress" | |
| /** | |
| * Represents the unique address of an singleton within the cluster. | |
| * | |
| * @category address | |
| * @since 4.0.0 | |
| */ | |
| export class SingletonAddress extends Schema.Class<SingletonAddress>(TypeId)({ | |
| shardId: ShardId, | |
| name: Schema.String | |
| }) { | |
| /** | |
| * Marks this value as a cluster singleton address for runtime guards. | |
| * | |
| * @since 4.0.0 | |
| */ | |
| readonly [TypeId] = TypeId; | |
| /** | |
| * Computes a structural hash from the singleton name and shard id. | |
| * | |
| * @since 4.0.0 | |
| */ | |
| [Hash.symbol]() { | |
| return Hash.string(`${this.name}:${this.shardId.toString()}`) | |
| } | |
| /** | |
| * Compares singleton addresses by name and shard id. | |
| * | |
| * @since 4.0.0 | |
| */ | |
| [Equal.symbol](that: SingletonAddress): boolean { | |
| return this.name === that.name && Equal.equals(this.shardId, that.shardId) | |
| } | |
| } | |
Xet Storage Details
- Size:
- 1.38 kB
- Xet hash:
- 1ff39b78885194d3b239595915b232cab6fd97376dd8d9cd0bd275f6deeb7136
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.