summaryrefslogtreecommitdiff
path: root/Utility/NotificationBroadcaster.hs
Commit message (Collapse)AuthorAge
* NotificationBroadcaster: Use SampleVars from SafeSemaphores instead of baseGravatar Ben Gamari2012-10-05
| | | | SampleVars from base are unsafe
* add NotificationID to StatusR, and use it to blockGravatar Joey Hess2012-07-28
|
* add derives needed for use with Yesod, and fix a bugGravatar Joey Hess2012-07-28
|
* add a newtypeGravatar Joey Hess2012-07-28
|
* add a NotificationBroadcaster to DaemonStatusGravatar Joey Hess2012-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.Gravatar Joey Hess2012-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.