Re: [whatwg] Proposal: requestBackgroundProcessing()

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@google.com> wrote:

> On Thu, Feb 20, 2014 at 7:25 AM, Ashley Gullen <ashley@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
>

Received on Thursday, 20 February 2014 18:08:37 UTC