Feature: allow setting reload timings for Phoenix Live View's live_socket

43 views
Skip to first unread message

Jayson Vantuyl

unread,
Dec 19, 2021, 12:15:32 AM12/19/21
to phoenix-core
Hello all,

Live View currently has a built-in retry and back-off mechanism for dealing with socket disconnections.  While it has very sensible defaults for most cases, there is some utility in being able to change those parameters.

Some use cases I've already encountered include:
* using LiveView in an embedded device, where longer retry timings and an earlier failsafe trigger are helpful
* browser tests, where reconnection attempts can drastically decrease testing runtime
* developing over really lossy links, where faster reconnection attempts help mask some of the delays
* very large sites, where even the defaults are can be a bit aggressive

I've currently implemented this on a branch here.

My feeling is that this is a relatively minor change.  While a number of people will absolutely use it to shoot themselves in the foot, I believe that the benefits for people who actually need it outweigh the "learning experiences" that others will create for themselves.

Thanks,

Jayson Vantuyl

José Valim

unread,
Dec 21, 2021, 3:54:15 AM12/21/21
to phoeni...@googlegroups.com
Thanks for asking! I would say go ahead and send a PR, it looks good to me but I don't make the calls on the JS code. :D

--
You received this message because you are subscribed to the Google Groups "phoenix-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phoenix-core...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/phoenix-core/699b004d-c8ea-49d7-b40d-4f31e76f7c95n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages