plugging-promise-race

Official

Prevent cross-iteration Promise.race leaks.

AuthorSocketDev
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Never re-race the same pool of promises across loop iterations. A reusable pool of .then handlers can accumulate across iterations, causing leaks and unpredictable behavior in concurrent loops.

Core Features & Use Cases

  • Safer concurrency: adopt a per-iteration single-waiter signal to avoid accumulating handlers.
  • Applies to Promise.race, Promise.any, and other short-circuiting constructs in iterative tasks.
  • Use case: stabilizing a worker loop that waits for several sources to resolve without growing the handler set.

Quick Start

Refactor your loop to create a fresh one-shot signal and await it before starting the next iteration.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: plugging-promise-race
Download link: https://github.com/SocketDev/socket-mcp/archive/main.zip#plugging-promise-race

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.