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: Add timeout options to TypedMessenger #767

Conversation

jespertheend
Copy link
Collaborator

@jespertheend jespertheend commented Oct 7, 2023

When the other end of the connection is untrusted, we can't assume that they will always respond to every request.
And even if the other end is trusted, the connection might still drop before the typedmessenger is destroyed.

This change adds two options:

  • a globalTimeout option in the constructor of the TypedMessenger, or the TypedMessenger.globalTimeout value which can be modified directly.
  • TypedMessenger.sendWithTransfer is now renamed to TypedMessenger.sendWithOptions and a timeout can be provided for specific requests.

@jespertheend jespertheend changed the title feat: Add timeout and responseless messages to TypedMessenger feat: Add timeout options to TypedMessenger Oct 7, 2023
@jespertheend jespertheend marked this pull request as ready for review October 7, 2023 21:21
@jespertheend jespertheend merged commit 7bb06c1 into rendajs:main Oct 7, 2023
8 checks passed
@jespertheend jespertheend deleted the 365-A-way-to-use-TypedMessenger-without-responses branch October 7, 2023 21:33
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