{"issue":{"created_at":"2011-11-29T19:04:24Z","state":"open","updated_at":"2011-12-08T19:00:20Z","comments":3,"user":{"gravatar_id":"adcdd5a613f7a9193b9f1056a356d77d","id":1120448,"url":"https://api.github.com/users/nalimilan","login":"nalimilan","avatar_url":"https://secure.gravatar.com/avatar/adcdd5a613f7a9193b9f1056a356d77d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"The extension is using synchronous API like GLib.file_get_contents() and\r\nGLib.spawn_command_line_sync(). This means that *the whole* desktop will freeze each time the graph is refreshed for as long as reading the file and running the command takes. This was reported in this bug:\r\nhttps://bugzilla.gnome.org/show_bug.cgi?id=664869\r\n\r\nUsing synchronous API is generally not recommended, but in the Shell it's really considered a bad practice. Please use asynchronous versions of the calls:\r\n- to read a file, use Gio.file_read_async [1].\r\n- to spawn a process, use Glib.spawn_command_line_async() [2].\r\n\r\n1: http://developer.gnome.org/gio/stable/GFile.html#g-file-read-aync\r\n2: http://developer.gnome.org/glib/stable/glib-Spawning-Processes.html#g-spawn-command-line-async","assignee":null,"id":2390377,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":16,"title":"Use asynchronous API","html_url":"https://github.com/xtranophilist/gnome-shell-extension-cpu-temperature/issues/16","closed_at":null,"url":"https://api.github.com/repos/xtranophilist/gnome-shell-extension-cpu-temperature/issues/16","milestone":null},"action":"created","comment":{"created_at":"2011-12-08T19:00:20Z","updated_at":"2011-12-08T19:00:20Z","user":{"gravatar_id":"0d6c2cb6d4e1ea125fdd18b3784a54d2","id":423047,"url":"https://api.github.com/users/xtranophilist","login":"xtranophilist","avatar_url":"https://secure.gravatar.com/avatar/0d6c2cb6d4e1ea125fdd18b3784a54d2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Had success with load_contents_async() and the callbacks.\r\n\r\nThe descriptor returned by spawn_async_with_pipes() is to be used with Gio.channel_unix_new() but there is no function such as. Tried all other possible ones like GLib.io_channel_unix_new(), etc. but no help.","id":3068078,"url":"https://api.github.com/repos/xtranophilist/gnome-shell-extension-cpu-temperature/issues/comments/3068078"}}