Discussions on Implementing a Server-based Digital Clock using Elixir LiveView

42
clicks
Discussions on Implementing a Server-based Digital Clock using Elixir LiveView
A user under the pseudonym zenom__ has initiated a thread pondering the practicality of using Phoenix LiveView to build a digital clock that ticks every second as opposed to a traditional JavaScript client-side implementation. The intention is to bypass any dependency on the client machine's clock settings. The individual crafted a functioning clock utilizing a timer and handle_info, triggering send_update to the LiveView child component. However, zenom__ voices uncertainty about the server impact this method entails. Community feedback largely cautions against the server-side approach for such a trivial task when scalability into thousands of users is a consideration. Others discuss the possibility of network lag affecting accuracy, the potential for similar accuracy issues on the server side, and default network time correction on major desktop operating systems. A few advocate for the negligible resource usage in Elixir and suggest more efficient solutions like pub/sub patterns with minute-level updates for lower noise. The application's context as a ham radio app introduces additional requirements like potentially needing second-level precision. Concerns about client connection reliability and alternative synchronization methods between client and server clocks were also raised.

© HashMerge 2024