Goal of this PR is to provide a websocket based implementation for live client updates on
new title suggestions and upvotes. A few things to note:
Patch is expecting some cinchize.yml changes, relevant file has to be updated in accordance
with the example file in the deployment environment
LIVE_MODE=[true|false] in the .env file will enable or disable live mode. Defaults to
true in the example file, but if set to false or undefined, system will disable the feature
as if it doesn't exist.
Socket bookkeeping is done on a request.ip basis by default. That means two clients cannot
be connected and receiving updates simultaneously -- the second connected client will force
disconnect the first. An experimental feature can be enabled via SOCKET_KEY_ID=true
in the .env file. This will attempt to bookkeep clients on a more granular, client specific basis.
It's experimental because I have no idea if the ID can be used reliably in this way! :tada:
There are probably some corner cases I've missed -- as can be seen in the update coffeescript,
the jquery can get a little low level and tedious. For something like this, a more reactive (heh) js framework would definitely improve the front end side of things, but we're basically talking about a rewrite there.
Goal of this PR is to provide a websocket based implementation for live client updates on new title suggestions and upvotes. A few things to note:
cinchize.yml
changes, relevant file has to be updated in accordance with the example file in the deployment environmentLIVE_MODE=[true|false]
in the.env
file will enable or disable live mode. Defaults totrue
in the example file, but if set tofalse
or undefined, system will disable the feature as if it doesn't exist.request.ip
basis by default. That means two clients cannot be connected and receiving updates simultaneously -- the second connected client will force disconnect the first. An experimental feature can be enabled viaSOCKET_KEY_ID=true
in the.env
file. This will attempt to bookkeep clients on a more granular, client specific basis. It's experimental because I have no idea if the ID can be used reliably in this way! :tada:There are probably some corner cases I've missed -- as can be seen in the update coffeescript, the jquery can get a little low level and tedious. For something like this, a more reactive (heh) js framework would definitely improve the front end side of things, but we're basically talking about a rewrite there.
README updates incoming...