{"id":5555,"date":"2012-08-04T11:39:00","date_gmt":"2012-08-04T16:39:00","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=5555"},"modified":"2012-08-09T16:46:28","modified_gmt":"2012-08-09T21:46:28","slug":"power-assertions","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2012\/08\/04\/power-assertions\/","title":{"rendered":"Power Assertions"},"content":{"rendered":"<p><a href=\"http:\/\/www.mikeabdullah.net\/power-assertions.html\">Mike Abdullah<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.mikeabdullah.net\/power-assertions.html\"><p>So I did a search for &ldquo;power assertions os x&rdquo; and frankly came up pretty blank. It seems Apple&rsquo;s documentation mostly consists of reproducing chunks of the header files. Not to worry, they&rsquo;re fairly easy to understand, so here for the benefit of future generations is a simple example&#8230;\n<\/p><\/blockquote>\n<p>Power assertions are a technology for preventing the Mac from going to sleep automatically. Mountain Lion is more aggressive about doing this, so applications need to tell it which operations shouldn&rsquo;t be interrupted. He&rsquo;s also posted a simple <a href=\"https:\/\/gist.github.com\/3258294\">Cocoa wrapper<\/a> for the relevant I\/O Kit APIs.<\/p>\n<p>Update (2012-08-09): <a href=\"http:\/\/useyourloaf.com\/blog\/2012\/08\/09\/keeping-mountain-lion-awake.html\">Keith Harrison<\/a>:<\/p>\n<blockquote cite=\"http:\/\/useyourloaf.com\/blog\/2012\/08\/09\/keeping-mountain-lion-awake.html\"><p>The pmset command (<code>\/usr\/bin\/pmset<\/code>) provides command-line access to many of the power management settings that are visible in the Energy Saver preferences pane. In addition it provides a way to view and manage power assertions. For example if I use iTunes to play some music it allows the display to sleep but a power assertion prevents the system from entering the idle sleep mode.<\/p><\/blockquote>\n<p>It can also show you which processes are preventing sleep.<\/p>","protected":false},"excerpt":{"rendered":"<p>Mike Abdullah: So I did a search for &ldquo;power assertions os x&rdquo; and frankly came up pretty blank. It seems Apple&rsquo;s documentation mostly consists of reproducing chunks of the header files. Not to worry, they&rsquo;re fairly easy to understand, so here for the benefit of future generations is a simple example&#8230; Power assertions are a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-5555","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/5555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=5555"}],"version-history":[{"count":4,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/5555\/revisions"}],"predecessor-version":[{"id":5651,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/5555\/revisions\/5651"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=5555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=5555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=5555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}