-
Notifications
You must be signed in to change notification settings - Fork 56
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
Tokio 0.2.7 #161
Tokio 0.2.7 #161
Conversation
Almost there.. Shutdown doesn't work, closing the TUI leaves clients hanging, I think. |
Indeed, |
Backtrace:
|
I think it's this loop in // Wait until all tasks have been released.
// XXX: this is a busy loop, but we don't really have any way to park
// the thread here?
while self.queues.has_tasks_remaining() {
self.queues.drain_pending_drop();
} In any case the shutdown code is not quite right anyway -- |
The loop is fixed on tokio master. We still need a way to wait on all tasks of a |
Tokio 0.2.3 is just released, and it fixes the hanging on shutdown. We still don't gracefully terminate the tasks. |
New optional config file field `timestamp_format` used as `strftime` format string used to show timestamps. To support `/reload` command `Line` now has a new `Option<Tm>` field. When format string is changed we visit all lines and update timestamp strings. (If this turns out to be too slow in practice we can re-generate timestamp strings lazily) Rendering performance should be the same: we still hold formatted strings in message areas, so instead of e.g. doing strftime every time a line is rendered we do the formatting once. Fixes #161
New optional config file field `timestamp_format` used as `strftime` format string used to show timestamps. To support `/reload` command `Line` now has a new `Option<Tm>` field. When format string is changed we visit all lines and update timestamp strings. (If this turns out to be too slow in practice we can re-generate timestamp strings lazily) Rendering performance should be the same: we still hold formatted strings in message areas, so instead of e.g. doing strftime every time a line is rendered we do the formatting once. Fixes #161
9cabe91
to
4a21e63
Compare
Quitting tiny (C-c in TUI) does not mean all clients will immediately stop: they'll send a QUIT message to the server, and depending on scheduling they may even receive a message or two. In those cases if we return from TUI right away when quitting we'd get panics in client code because client assumes the receiving end of the connection event channel is always open until the client returns. We now keep the UI task running until all client channels are dropped. Because the UI task is the owner of the TUI this avoids the race (TUI is awailable as long as there's at least one client running) by keeping the TUI alive. A good side effect of this is that after C-c we won't be waiting in the shell for the process to exit (i.e. clients to send QUIT), instead we'll see the TUI.
This is good to go. |
Fixes #160