Skip to content

Alternate Promise.race() implementation which doesn't leak memory, courtesy Brian Kim (https://github.com/brainkim)

License

Notifications You must be signed in to change notification settings

digitalloggers/race-as-promised

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

race-as-promised

This module implements Promise.race() in a way that does not leak memory.

Rationale

The V8 Promise implementation does leak memory in many common Promise.race([...]) call cases; see e.g. nodejs/node#17469.

The V8 Promise implementation is likely not going to be fixed.

See also: https://bugs.chromium.org/p/v8/issues/detail?id=9858

Installation

npm install race-as-promised

Usage

const race = require ("race-as-promised");

// Use race([...]) instead of Promise.race([...])

Author

The source code and test core have been made available under The Unlicense by Brian Kim, to whom we owe our gratitude.

An additional issue in the original code has been found and fixed by Dan Bornstein, whose efforts are likewise appreciated.

License

The Unlicense

About

Alternate Promise.race() implementation which doesn't leak memory, courtesy Brian Kim (https://github.com/brainkim)

Resources

License

Stars

Watchers

Forks

Packages

No packages published