top | item 42817175

(no title)

atul-jalan | 1 year ago

Node has similar libraries like Socket.IO too, but it over-abstracts it a bit in my opinion.

discuss

order

hombre_fatal|1 year ago

I've done my share of building websocket servers from scratch, but when you don't use libraries like ActiveCable or socket.io, you have to build your own MessageID reconciliation so that you can have request/response cycles. Which is generally what you want (or eventually want) in a websocket-heavy application.

    send(payload).then(reply => ...)

atul-jalan|1 year ago

Yep, for our application, we have an `executionId` that is sent in essentially every single WebSocket message.

But client and server use it to maintain a record of events.

dilyevsky|1 year ago

At this point why even use a websocket vs a normal request/reply technology like grpc or json-rpc?

mirekrusin|1 year ago

Or just use jsonrpc.

p_l|1 year ago

If you add Content-Negotiation it will have ALL the OSI layers! /s

Honestly, I'm a little surprised and more than a bit depressed how we effectively reinvent the OSI stack so often...