-
Notifications
You must be signed in to change notification settings - Fork 301
fix: make stdio shutdown more graceful #364
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
Conversation
8159d42
to
da87299
Compare
I'm not sure if adding a shutdown interface is necessary, although it may increase some flexibility for the caller, it may be redundant for the SDK. For me, the previous direct killing behavior was not very elegant, and I would like to hear more opinions.How about you ? |
I prefer to have a easier approch to cleanup in drop, and give user more flexibility in another explicit method. Or maybe we can just provide an into_inner method so the user can do anything they like with inner process. We can also wrap this wait-and-kill approch into a method, just as @crepererum metioned. |
Approve , I will change it. |
How about expose the transport in running service? @4t145 |
@jokemanfire Just have a look on the original issue
|
c494dbf
to
9f38473
Compare
@4t145 @crepererum Have a look , and pls check. |
And what's your opinion about give back the ownership of transport after shutdown? Maybe we don't implement this feature in this pr, but it still a point to be discussed. |
According to the protocol specifications Signed-off-by: jokemanfire <[email protected]>
If we want to return ownership of the transport, I don't think it should be in the close interface. This can lead to misunderstandings in our understanding of the close interface. I suggest that if necessary, we can set up new interface extensions, and not every transport needs to implement ownership. I have added the into_inner interface for future extensions. |
I mean, return it as serve task's result maybe change this pub async fn waiting(self) -> Result<QuitReason, tokio::task::JoinError> to pub async fn waiting(self) -> Result<(QuitReason, T), tokio::task::JoinError> But it will make more difficult to make |
Thank you 🙂 |
According to the protocol specifications
Motivation and Context
Make shutdown more graceful.
How Has This Been Tested?
Ut
Breaking Changes
No breaking change
Types of changes
Checklist
Additional context