const domainToPort = { 'localhost:3000': 3001, 'example.com': 3002, 'api.example.com': 3003, };
6 karma · joined December 16, 2022
const domainToPort = { 'localhost:3000': 3001, 'example.com': 3002, 'api.example.com': 3003, };
I think it got a little confused with my last prompt: "Make both players also able to submit the input with the enter key." It correctly added the functionality, but it left it's explanation in the HTML of the page too. Still very cool. Here is the working game: https://backend-pico.onrender.com/hyundai-interface
Example w/ retries config: https://github.com/durkes/wubsub/blob/main/examples/client.j...
Regarding the backpressure for messages that the client is trying to publish while not connected, they will each be held in a setTimeout recursively until successful trying every 500ms also. If you build in your own custom receipt logic, this could be avoided. I considered building this in but wanted to keep it simple. Open to suggestions.
Messages that the client publishes while trying to connect are pending also every 500ms to try to resend as soon as it connects. This might be something that should be customizable to return an error or retry in a future version.
Because this design is send and forget / fire and forget (similar to redis), messages published when a client is not connected will not make it to that client. If receipt confirmations are needed, it would need to be coded into the app using pubsub.
Thanks for the reply! I will get this info added to the docs soon.