aboutsummaryrefslogtreecommitdiff
path: root/Utility/NotificationBroadcaster.hs
Commit message (Collapse)AuthorAge
* webapp: Fix a race that sometimes caused alerts or other notifications to be ↵Gravatar Joey Hess2013-03-27
| | | | | | | | | | | | | | | | | | | missed if they occurred while a page was loading. When a page is loaded, the javascript requests an notification url, and does long polling on the url to be informed of changes. But if a change occured before the notification url was requested, it would not be notified of that change, and so the page display would not update. I fixed this by *always* updating the page display after it gets the notification url. This is extra work, but the overhead is not noticable in the other overhead of loading a page. (A nicer way would be to somehow record the version of a page initially loaded, and then compare it with the current version when getting the notification url, and only force an update if it's changed. But getting the "version" of the different parts of the page that use long polling is difficult.)
* finished where indentation changesGravatar Joey Hess2012-12-13
|
* 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.