[whatwg] Proposal: requestBackgroundProcessing()
Ashley Gullen
ashley at scirra.com
Thu Feb 20 10:02:09 PST 2014
The host needs to keep simulating the world even when no network events are
occurring. That can't happen if rAF isn't firing and timers only run at 1
Hz.
On 20 February 2014 17:56, James Robinson <jamesr at google.com> wrote:
> On Thu, Feb 20, 2014 at 7:25 AM, Ashley Gullen <ashley at scirra.com> wrote:
>
>> The host is effectively acting as the
>> game server, and this basically hangs the server. If there were 20 peers
>> connected to the host, the game hangs for all 20 players.
>>
>
> That's a bug in your application design. If one web page is performing
> operations necessary for things orthogonal to that page's visual display,
> those operations should not be tied to a requestAnimationFrame loop. If
> the host is responding to network updates from other clients, for instance,
> then it could perform that work in response to the network events coming
> in. The page may also be performing the normal game updates for that one
> client in a rAF loop concurrently.
>
> - James
>
More information about the whatwg
mailing list