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

Abort handling #82

Draft
wants to merge 1 commit into
base: bencmbrook/jsbi
Choose a base branch
from
Draft

Abort handling #82

wants to merge 1 commit into from

Conversation

bencmbrook
Copy link
Member

@bencmbrook bencmbrook commented Sep 25, 2020

This bug wasn't caught by tests.

This PR is currently in the test-writing stage, not bugfix. Closes #56

@bencmbrook bencmbrook marked this pull request as draft September 25, 2020 08:14
@bencmbrook bencmbrook changed the base branch from master to bencmbrook/jsbi September 25, 2020 08:14
const outputWritable = getOutputWritable({ long: true });

try {
const promise = readable.pipeTo(outputWritable);
Copy link
Member

@eligrey eligrey Sep 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const promise = readable.pipeTo(outputWritable);
const controller = new AbortController();
const { signal } = controller;
const promise = readable.pipeTo(outputWritable, { signal });
controller.abort();

I think our abortion semantics should use AbortController, so you can pass in signal here.

@bencmbrook
Copy link
Member Author

bencmbrook commented Sep 25, 2020

https://developer.mozilla.org/en-US/docs/Web/API/AbortController

Haven't used this before. Looks good though. Does this change the implementation (given our class extends TransformStream) or just recommended API?

@eligrey
Copy link
Member

eligrey commented Sep 25, 2020

This will change our implementation and also add an additional API surface to for API consumers to input an AbortController (probably during conflux.Writer instantiation).

@bencmbrook
Copy link
Member Author

@eligrey given transcend-io/penumbra#148 are there any changes required to Conflux for abort handling?

@eligrey
Copy link
Member

eligrey commented Sep 30, 2020

It doesn't seem like it's actually necessary to expose an explicit AbortController in Conflux with Penumbra's wrapper.

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.

2 participants