W3C home > Mailing lists > Public > public-device-apis-log@w3.org > May 2017

Re: [sensors] Call 'onchange' on a Senor instance considering its own frequency hint

From: Mikhail Pozdnyakov via GitHub <sysbot+gh@w3.org>
Date: Fri, 26 May 2017 12:27:05 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-304270408-1495801623-sysbot+gh@w3.org>
> OK. So is the only point of the cache to make sure that sensor.x doesn't change if queried in between when events are fired?

Not really, the point is that Sensor A is decoupled from Sensor B. 
For example if you start a _slow sensor_  { frequency : 1 } and listen to `onchange` from it you anticipate this `onchange` to be called once per second, later you start a _fast sensor_ {frequency : 40 } but you still expect to receive notification from the  _slow sensor_ once per second. However, with the current ED you will suddenly get it 40 times per second, and then when _fast sensor_ stops, you'll get it again once per second :) 


-- 
GitHub Notification of comment by pozdnyakov
Please view or discuss this issue at https://github.com/w3c/sensors/issues/152#issuecomment-304270408 using your GitHub account
Received on Friday, 26 May 2017 12:27:11 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 12:18:53 UTC