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(websocket client): WIP V2 ring buffer channel #165

Closed
wants to merge 3 commits into from

Conversation

niklasad1
Copy link
Member

Super far from being mergeable but it fixes the deadlock at least in #143

It makes is it user-configurable to allow losses for requests and subscriptions

  • ring channel => allow losses
  • mpsc::channel => don't push work on the queue if the channel is full.

@@ -19,6 +19,7 @@ parking_lot = "0.11.1"
pin-project = "1.0.1"
jsonrpsee-proc-macros = { path = "proc-macros" }
rand = "0.7.3"
ring-channel = { git = "https://github.com/niklasad1/ring-channel.git", branch = "na-atomicptr" }
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Were you planning to open a PR for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's up to the author of the library, he doesn't seem to be very keen on using AtomicPtr instead of NonNullPtr let's see how it goes. However, the idea is to split this PR into two parts when it works properly

  1. Extract try_send/send.now_or_never into a separate PR and handle the errors without ring channel crate
  2. Support for ring channel for ring channel.

}

impl<T> InternalChannelSender<T> {
fn send(self, data: T) -> Result<(), Error> {
Copy link
Member Author

@niklasad1 niklasad1 Nov 25, 2020

Choose a reason for hiding this comment

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

TODO: rename to send_non_blocking and provide an additional method send_async or something

@niklasad1
Copy link
Member Author

It's up to the author of the library, he doesn't seem to be very keen on using AtomicPtr instead of NonNullPtr let's see how it goes. However, the idea is to split this PR into two parts when it works properly

1. Extract `try_send/send.now_or_never` into a separate PR and handle the errors without `ring channel crate`

2. Support for ring channel for ring channel.

I will split this into two different PRs instead

@niklasad1 niklasad1 closed this Nov 26, 2020
@niklasad1 niklasad1 deleted the v2-ring-buffer-channel branch January 7, 2021 13:20
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