I would like to see an extension to the spec that allows the gamepad API to be accessed directly from within web workers.
It is extremely difficult to avoid blocking and stalls in a window's main javascript context. Moving gamepad interactions to a worker avoids blocking related to other events flooding the window context and may reduce stalls related to garbage collection on some browsers.
With WebGL coming Web Workers, many more applications that make use of gamepads will likely be moving entirely within workers and will prefer to access gamepad data from workers instead of needing to read gamepad data outside of workers and send it there.
Gamepad access from workers is essential for haptic support. Haptic features that apply forces or limit motion require a high frequency feedback loop of reading controller inputs and updating force values. Outside of the trivial case of vibration, these features will not work well outside of workers.
I would like to see an extension to the spec that allows the gamepad API to be accessed directly from within web workers.
It is extremely difficult to avoid blocking and stalls in a window's main javascript context. Moving gamepad interactions to a worker avoids blocking related to other events flooding the window context and may reduce stalls related to garbage collection on some browsers.
With WebGL coming Web Workers, many more applications that make use of gamepads will likely be moving entirely within workers and will prefer to access gamepad data from workers instead of needing to read gamepad data outside of workers and send it there.
Gamepad access from workers is essential for haptic support. Haptic features that apply forces or limit motion require a high frequency feedback loop of reading controller inputs and updating force values. Outside of the trivial case of vibration, these features will not work well outside of workers.