Skip to content

Abort handling#82

Draft
bencmbrook wants to merge 1 commit intobencmbrook/jsbifrom
bencmbrook/abort
Draft

Abort handling#82
bencmbrook wants to merge 1 commit intobencmbrook/jsbifrom
bencmbrook/abort

Conversation

@bencmbrook
Copy link
Copy Markdown
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
Comment thread test/write.test.js
const outputWritable = getOutputWritable({ long: true });

try {
const promise = readable.pipeTo(outputWritable);
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

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

@eligrey
Copy link
Copy Markdown
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