I'm teaching myself about Mojolicious and websockets. So far I've got a web page that displays rows from a database, and has buttons to add, delete, and update rows, and to select columns for sorting.
At the moment, it uses 'one-shot' websockets in the javascript 'onclick' handlers for each button, and that works.
Would it be more in-keeping with the intention of websockets, for the sockets to be kept alive and used for multiple clicks? I think the answer should be 'yes', because otherwise it will get messy if the user clicks a button several times quickly.
And, as a question of style, should I just have one websocket that handles different types of interaction between browser and server, or separate websockets for each type? Having one websocket would require code to analyse the messages and decide what to do about them. Whereas several websockets would each be simpler, but that would require repetition of error-handling code etc.
I know that's a wordy and philosophical question, but I want to get overall shape of the application right before I develop it further.