-
Notifications
You must be signed in to change notification settings - Fork 31
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
rust/python: Ability to clear session #211
rust/python: Ability to clear session #211
Conversation
Is there more than one session? Why would it be plural? If there are multiple connections I could see that. |
There is only one "session" in the context of the protocol, but there can be multiple clients, which a layperson might consider a session. I'm not sure what the mcap equivalent would be - probably closing the file and starting a new one, but that seems out of scope. |
The "robot sessions" concept seems relevant to consider here if you want to use the word "session". This is a function on the server which is separate - yes - and seems fine as you propose but might be useful to think about how it will or won't be confusing if we later introduce a higher-level "session" or "run" concept. |
…g-10462-easy-way-to-clear-screen-reset-session-id
True. What about just |
Maybe clear_client_sessions() or reset_client_sessions()? The name is ok as-is. |
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.
One line of code to delete, otherwise LGTM. I'm still unsure on the name.
clear() seem to generic. I like clear_session more. I think it can stay as-is.
@@ -69,13 +69,16 @@ fn main() -> Result<()> { | |||
let summary = Summary::load_from_mcap(&args.file)?; | |||
|
|||
info!("Waiting for client"); | |||
std::thread::sleep(Duration::from_secs(5)); | |||
std::thread::sleep(Duration::from_secs(1)); |
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.
Everybody's in such a gosh-darned rush.
We could also just skip the sleep when the --loop
argument is provided.
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.
🤣 I wasn't sure what this was even for. but I already have my client up and was restarting the server a bunch so the sleep was annoying
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.
It was for the non-looping case, where you want to wait a moment for the client to get connected and subscribe to channels after starting the server, but before transmitting the data.
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.
I see. Could we make it wait up to 5 seconds for a client to connect, but if a client connects then start streaming immediately?
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.
Yeah, that'd be nice. When I initially wrote it, we didn't have the callbacks for that, but we do now.
Changelog
Add
server.clear_session()
method to Rust and PythonDocs
None
Description
Builds on top of #196, since it perfectly demonstrated the problem.
Discussion: Are we happy with
server.clear_session()
? I also thought aboutserver.reset_session()
, but I feel like "clear" is a bit more obvious to the user why you would call this. Any other suggestions?Maybe it should be plural,
server.clear_sessions()
? Or maybe justserver.clear()
?