How to abort realtime connection when request ends?
I'm building a realtime chat app, and evaluating Ably to use as a Pub/Sub solution in my worker (I have a GraphQL subscription that subscribes to incoming pubsub messages from Ably, does some processing to the payload, then passes it to my React frontend).
I noticed that (at least when testing locally) every request would start a new Ably connection, and it wouldn't disconnect. Hence I hit my peak Ably connection limit whilst I was developing. Can you help me resolve this please?
I'm using GraphQL Yoga server, but here is a simpler example to reproduce the issue. Note I attempted to add code to detect the "abort" signal, but it's never getting triggered.
Thanks! 🙂
0 Replies