Trying to keep a server and clients in time sync is a really hard problem!
Actually, it's more or less an impossible problem in the general case as
time drift between nodes in inevitable and timing accuracy is limited by
relativity. I would look at this article
http://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time
as well as this one http://ferd.ca/beating-the-cap-theorem-checklist.html

Zach
ᐧ

On Mon, Jun 5, 2017 at 10:00 AM, RGBboy <l-...@rgbboy.com> wrote:

> On Safari/node setInterval does indeed exhibit the same issue so this is
> not a bug in Elms core. However Elm does have an opportunity to smooth this
> inconsistency out.
>
> What I have done so far to mitigate this issue is essentially what you
> describe. I have experimented with a couple of different solutions to find
> one that is simple to use. The implementation that I have found most simple
> so far (for the consumer) is an effects manager that uses Time.now and
> Process.sleep instead of setInterval.
>
> As for not relying on fixed interval messages, this is not something that
> my application can do. I am running a deterministic simulation on a server
> and multiple clients. In order for the clients and server to stay in sync
> they must stay close in timestep. It does have tolerance for some drift,
> however as drift increases the servers simulation gets more out of sync
> with the clients.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Zach Kessin
Teaching Web Developers to test code to find more bugs in less time
Skype: zachkessin
+972 54 234 3956 / +44 203 734 9790 / +1 617 778 7213

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to