[erlang-questions] Erlang and sleep mode under Windows

zxq9 <>
Thu Sep 7 08:14:45 CEST 2017

On 2017年09月07日 木曜日 15:07:23 zxq9 wrote:
> On 2017年09月07日 木曜日 15:03:09 zxq9 wrote:
> > -spec os:subscribe(pid(), power_state) -> ok | {error, term()}.
> > 
> > (Looking at the spec of that function I am obviously envisioning more uses for that than just power states...)
> Now that I take a second look at that, it is clear to me that an AHCI subscription and query interface would be immensely useful.

And ACPI. (I was conflating these two in my mind.)

Along with that, any other similar generally uniformly available power/hardware/system status type protocols.

I believe the best we can do at the moment is figure out which environment we're in and open a port or make a query (if available) via os:command/1. It might be possible to tail a log file in some environments. Anyway, this seems a lot trickier to work out than having runtime interfaces to AHCI, ACPI, etc.


More information about the erlang-questions mailing list