We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
AsyncRuntime
Trait AsyncRuntime exposes various associated channel types:
Currently, both MPSC and Watch are exposed through traits:
https://github.com/datafuselabs/openraft/blob/ec284cb4813019d8b3a43a8cd74f3e1aa39eb882/openraft/src/type_config/async_runtime/mod.rs#L120-L122
Oneshot is different, it is scattered in the trait:
pub trait AsyncRuntime: Debug + Default + PartialEq + Eq + OptionalSend + OptionalSync + 'static { // Other fields are omitted type OneshotSender<T: OptionalSend>: OneshotSender<T> + OptionalSend + OptionalSync + Sized; type OneshotReceiverError: std::error::Error + OptionalSend; type OneshotReceiver<T: OptionalSend>: OptionalSend + OptionalSync + Future<Output = Result<T, Self::OneshotReceiverError>> + Unpin; fn oneshot<T>() -> (Self::OneshotSender<T>, Self::OneshotReceiver<T>) where T: OptionalSend; }
To provide a consistent interface, I kinda think we should expose Oneshot in the way used by MPSC and Watch, i.e., something like:
pub trait Oneshot { type Sender<T: OptionalSend>: OneshotSender<T>; type Receiver<T: OptionalSend>: OptionalSend + OptionalSync + Future<Output = Result<T, Self::ReceiverError>> + Unpin; type ReceiverError: std::error::Error + OptionalSend; fn channel<T>() -> (Self::Sender<T>, Self::Receiver<T>) where T: OptionalSend; } pub trait AsyncRuntime: Debug + Default + PartialEq + Eq + OptionalSend + OptionalSync + 'static { // Other fields are omitted type MpscUnbounded: MpscUnbounded; type Watch: Watch; type Oneshot: Oneshot; }
The text was updated successfully, but these errors were encountered:
👋 Thanks for opening this issue!
Get help or engage by:
/help
/assignme
Sorry, something went wrong.
SteveLauC
Successfully merging a pull request may close this issue.
Trait
AsyncRuntime
exposes various associated channel types:Currently, both MPSC and Watch are exposed through traits:
https://github.com/datafuselabs/openraft/blob/ec284cb4813019d8b3a43a8cd74f3e1aa39eb882/openraft/src/type_config/async_runtime/mod.rs#L120-L122
Oneshot is different, it is scattered in the trait:
To provide a consistent interface, I kinda think we should expose Oneshot in the way used by MPSC and Watch, i.e., something like:
The text was updated successfully, but these errors were encountered: