Basically:
- we need to assign a unique id and track all open websockets running
- we need to new builtin message_websocket(id) that sends a message out that id
- then we need let a websocket connection handler know its websocket id so that it can also make an app or group list with websocket ids
So this would work fine. My only concern is if we want to do any filtering through a wait(ing) websocket handler. Maybe we add another builtin function that sends a message through a websocket's input queue. Need to see some other websocket implementations and compare to see the most intuitive and Duso like option or if this is even necessary.
This brings up a point that our wait functions for datastore etc would be nice to pass in an array of keys to watch. though, that would be problematic from an atomic standpoint. We'd have to queue up goroutine change messages if we don't already (I don't recall).
Basically:
So this would work fine. My only concern is if we want to do any filtering through a wait(ing) websocket handler. Maybe we add another builtin function that sends a message through a websocket's input queue. Need to see some other websocket implementations and compare to see the most intuitive and Duso like option or if this is even necessary.
This brings up a point that our wait functions for datastore etc would be nice to pass in an array of keys to watch. though, that would be problematic from an atomic standpoint. We'd have to queue up goroutine change messages if we don't already (I don't recall).