|
|
@ -142,7 +142,7 @@ export default class AbortablePromise<T> implements Promise<T | null> {
|
|
|
|
static deadlyRace<L>(
|
|
|
|
static deadlyRace<L>(
|
|
|
|
promises: AbortablePromise<L>[],
|
|
|
|
promises: AbortablePromise<L>[],
|
|
|
|
should_kill_others: (arg: L) => Promise<boolean> = async () => true
|
|
|
|
should_kill_others: (arg: L) => Promise<boolean> = async () => true
|
|
|
|
): Promise<L> {
|
|
|
|
): AbortablePromise<L> {
|
|
|
|
return new AbortablePromise(async function* (await_or_abort) {
|
|
|
|
return new AbortablePromise(async function* (await_or_abort) {
|
|
|
|
return await_or_abort(
|
|
|
|
return await_or_abort(
|
|
|
|
new Promise((resolve, _) => {
|
|
|
|
new Promise((resolve, _) => {
|
|
|
|