Trying to understand the Promise usage in the battery API

I was asked to review a patch to Gecko to align our implementation of 
the battery API to http://www.w3.org/TR/2014/CR-battery-status-20141209/ 
and I'm not sure I understand the intent of the Promise usage in that 
specification.

The Promise just returns a manager object; this doesn't particularly 
need to be an async operation (though it can be one, of course).  But 
all the operations for querying the actual hardware state are then 
synchronous, and _those_ are what I would expect one might want to do 
asynchronously.

I looked through the list archives, but can't seem to find the rationale 
for the current design; if there is one there, I would appreciate a 
pointer to it.

Thanks,
Boris

Received on Wednesday, 29 July 2015 17:27:30 UTC