W3C home > Mailing lists > Public > public-device-apis-log@w3.org > December 2016

Re: [sensors] Don't allocate response objects to avoid triggering GC

From: moka via GitHub <sysbot+gh@w3.org>
Date: Tue, 06 Dec 2016 15:11:54 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-265174448-1481037111-sysbot+gh@w3.org>
@tobie, this design would allow getting state of data, without 
allocation on changes. And would allow to subscribe to data changes.
Which ticks both use cases: async and sync.
And prevents allocations.

This is actually is a good option here.

Although, this pattern will only work for singleton sensor types - 
there is only one gyro, and one accelerometer ever?
Does Sensors API assumes that there might be multiple sensors of the 
same type?
Lets say there are two controllers, like HTC Vive Controller, so you 
can have multiple attached. Does Sensors API covers this types of 
sensors too?

GitHub Notification of comment by Maksims
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/153#issuecomment-265174448 using
 your GitHub account
Received on Tuesday, 6 December 2016 15:12:12 UTC

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