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

fix: handle outdated message in channel queue #184

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jedlikowski
Copy link

@jedlikowski jedlikowski commented Sep 4, 2024

Fixes #183

Copy link

changeset-bot bot commented Sep 4, 2024

⚠️ No Changeset found

Latest commit: 9f59e96

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codesandbox-ci bot commented Sep 4, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@JounQin
Copy link
Member

JounQin commented Sep 6, 2024

What's the issue here? Can you provide more information? Reproduction or failing test for example.

@jedlikowski jedlikowski marked this pull request as draft September 9, 2024 05:17
@jedlikowski
Copy link
Author

jedlikowski commented Sep 9, 2024

Hi, sorry, it was meant to be a draft PR ;) I've linked in the description to the issue this PR means to fix.

@jedlikowski
Copy link
Author

jedlikowski commented Sep 9, 2024

Hi, I've added one more change to avoid sending the worker task result to parent if parent isn't waiting for the result anymore. Let me know what you think of this PR and I'll be happy to carry it to the end :)

I also wondered how we could pass some sort of EventEmitter to the task function itself, to let it know that the task has been aborted. This would allow it for example to cancel a HTTP request, but I couldn't figure out a way to do it without changing the library API.

This chart aims visualize the current behavior (dotted line means Atomics.wait() timeout on parent process):
image

While this one shows the updated behavior:
image

@jedlikowski
Copy link
Author

Hi, @JounQin, what do you think of this PR? Would you be interested in such a contribution?

@jedlikowski jedlikowski marked this pull request as ready for review September 17, 2024 10:14
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.

syncFn timeout causes subsequent calls to fail.
2 participants