Re: [sensors] Batching API for sensor readings

The previous proposal looks a bit clumsy and not sufficient for some 
use cases 
(https://github.com/w3c/sensors/issues/171#issuecomment-282032472) , 
so another approach:

```
interface MotionSensor : Sensor {
  /**
   * Populates the passed array with the sensor readings.
   *
   * The returned promise is resolved when the buffer gets full or 
when sensor stops.
   *
   * The returned promise is rejected if sensor wasn't yet started or 
if an error has
   * occurred.
   */
   Promise<> populateBuffer(Float64Array array);
}
```

For implementing this we could start a new thread collecting readings 
in background until the required amount of data is collected.

@tobie, PTAL

-- 
GitHub Notification of comment by pozdnyakov
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/171#issuecomment-282697255 using
 your GitHub account

Received on Monday, 27 February 2017 11:37:27 UTC