Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: KillSignalController #169

Merged
merged 5 commits into from
Aug 5, 2023
Merged

feat: KillSignalController #169

merged 5 commits into from
Aug 5, 2023

Conversation

dsherret
Copy link
Owner

@dsherret dsherret commented Aug 5, 2023

import $, { KillSignalController } from "...";

const controller = new KillSignalController();
const signal = controller.signal;

const promise = Promise.all([
  $`sleep 1000s`.signal(signal),
  $`sleep 2000s`.signal(signal),
  $`sleep 3000s`.signal(signal),
]);

$.sleep("1s").then(() => controller.kill());

await promise; // throws after 1 second

@dsherret dsherret changed the title feat: CommandSignalController feat: KillSignalController Aug 5, 2023
@dsherret dsherret marked this pull request as ready for review August 5, 2023 22:21
@dsherret dsherret merged commit b76463d into main Aug 5, 2023
4 checks passed
@dsherret dsherret deleted the feat_command_signal_controller branch August 5, 2023 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant