-
Notifications
You must be signed in to change notification settings - Fork 55
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
refactor: Deprecate unused actor methods and types #2784
refactor: Deprecate unused actor methods and types #2784
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
Robot Results
|
let mut test_box = SimpleMessageBoxBuilder::new("Test box", 16); | ||
test_box.connect_sink(NoConfig, &builder.connect_client(test_box.get_sender())); | ||
let mut test_box = test_box.build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not the former variant itself, which is the same but simpler?
let mut test_box = SimpleMessageBoxBuilder::new("Test box", 16); | |
test_box.connect_sink(NoConfig, &builder.connect_client(test_box.get_sender())); | |
let mut test_box = test_box.build(); | |
let mut test_box = builder.new_client_box(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a residue of my attempt to fully remove the new_client_box()
test helper.
Reverted.
let mut test_box = SimpleMessageBoxBuilder::new("Test box", 16); | ||
test_box.connect_sink( | ||
NoConfig, | ||
&self.box_builder.connect_client(test_box.get_sender()), | ||
); | ||
test_box.build() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a residue of my attempt to fully remove the new_client_box()
test helper.
Reverted.
@@ -151,6 +156,9 @@ pub trait Service<Request: Message, Response: Message>: | |||
/// The client provides a `response_sender` on which it wants to response to be sent to. | |||
/// In exchange the client is returned a request sender on which its requests will have to be sent. | |||
fn connect_client(&mut self, response_sender: DynSender<Response>) -> DynSender<Request>; | |||
|
|||
/// Create a simple message box connected to a server box under construction. | |||
fn new_client_box(&mut self) -> SimpleMessageBox<Response, Request>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if this function should this be hidden behind a test feature flag to make the intent clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hidden behind #[cfg(feature = "test-helpers")]
This method was only used in a test. Also deprecate `WrappedInput` type. Which was adding little compared to Result<Option<Input>, RuntimeRequest>. Signed-off-by: Didier Wenzek <[email protected]>
My plan was to fully deprecate the RuntimeEvent type. However, these events are actually useful to test the runtime. So let this unchanged for now. Signed-off-by: Didier Wenzek <[email protected]>
I'm proud of this Probe abstraction which really demonstrate the flexibility of the actor builder traits. However, this abstraction is used by not even a single test. Aiming to reduce the number of concepts introduce by this crate, I prefer to remove it. Signed-off-by: Didier Wenzek <[email protected]>
The new_client_box method has not been fully deprecated but moved to the Service trait. This makes this trait a bit more contrieved (with 3 ways to connect clients) and will have to be fixed. However, I prefer this temporary situation because moving the method in a trait Ext was only hidding the issue. I will address that in a following step. Signed-off-by: Didier Wenzek <[email protected]>
b144b96
to
e508f11
Compare
Proposed changes
MessageReceiver::recv_message()
enum WrappedInput
enum RuntimeEvent
(from the public API - still used internally)trait ServiceConsumerExt
and thewith_probe()
test helpertrait ServiceProviderExt
and thenew_client_box()
test helperTypes of changes
Paste Link to the issue
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments