You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are serval problems in rpc::Connection garbage collection now.
Connection::cancel_requests() duplicated used
Connection.active is useless
Another way to close the ConnectionSender/Reader/Connection gracefully. The reason why we use shutdown() to close the connection is that we have to use send(closepoison_packet).await to close ConnectionSender. I guess the oneshot::channel or active mentioned before could help to close the ConnectionSender. If we don't send the packet in close() asynchrony, we could implement a common way to drop/close the connection synchrony.
Enhancement
There are serval problems in rpc::Connection garbage collection now.
Connection::cancel_requests()duplicated usedConnection.activeis uselessshutdown()to close the connection is that we have to usesend(closepoison_packet).awaitto close ConnectionSender. I guess theoneshot::channeloractivementioned before could help to close theConnectionSender. If we don't send the packet inclose()asynchrony, we could implement a common way to drop/close the connection synchrony.