Commit message (Collapse) | Author | Age | |
---|---|---|---|
* | NotificationBroadcaster: Use SampleVars from SafeSemaphores instead of base | Ben Gamari | 2012-10-05 |
| | | | | SampleVars from base are unsafe | ||
* | add NotificationID to StatusR, and use it to block | Joey Hess | 2012-07-28 |
| | |||
* | add derives needed for use with Yesod, and fix a bug | Joey Hess | 2012-07-28 |
| | |||
* | add a newtype | Joey Hess | 2012-07-28 |
| | |||
* | add a NotificationBroadcaster to DaemonStatus | Joey Hess | 2012-07-28 |
| | | | | | First use of it is to make the status checkpointer thread block until there is really a change to the status. | ||
* | Focus today was writing a notification broadcaster. | Joey Hess | 2012-07-28 |
This is a way to send a notification to a set of clients, any of which can be blocked waiting for a new notification to arrive. A complication is that any number of clients may be be dead, and we don't want stale notifications for those clients to pile up and leak memory. It took me 3 tries to find the solution, which turns out to be simple: An array of SampleVars, one per client. Using SampleVars means that clients only see the most recent notification, but when the notification is just "the assistant's state changed somehow; display a refreshed rendering of it", that's sufficient. |