Lists all known shards
Returns an array of all shard binding names known to the system. First attempts to get the list from the Durable Object coordinator for the most up-to-date information, then falls back to the configured shards if the coordinator is unavailable.
Promise resolving to array of shard binding names
const shards = await listKnownShards();console.log('Available shards:', shards);// Output: ['db-east', 'db-west', 'db-central']// Check if a specific shard is availableif (shards.includes('db-asia')) { console.log('Asia region shard is available');} Copy
const shards = await listKnownShards();console.log('Available shards:', shards);// Output: ['db-east', 'db-west', 'db-central']// Check if a specific shard is availableif (shards.includes('db-asia')) { console.log('Asia region shard is available');}
Lists all known shards
Returns an array of all shard binding names known to the system. First attempts to get the list from the Durable Object coordinator for the most up-to-date information, then falls back to the configured shards if the coordinator is unavailable.