Hey there. Is there any possibility we
Hey there. Is there any possibility we could get a method for hibernatable websockets to set/update the tags on an already established connection?
I'm using tags as a rudimentary way to publish messages to subscribers of given topics, and it'd be nice to be able to change a subscriber's topics without needing it to reconnect. I could probably use a serialized attachment for that, but then I'd need to iterate over all connections whenever publishing a message which seems problematic in its own way.
3 Replies
This has come up in the past https://github.com/cloudflare/workerd/issues/958#issuecomment-1665845002, I imagine it's technically feasible, but given the complexity + our other priorities we wouldn't be able to get to this for quite some time. Would this even scale for you though? What if a subscriber was interested in 11 topics, but there are only 10 tags available?
GitHub
Feature Request - get tags of (Hibernated) WebSocket ยท Issue #958 ยท...
Hi ๐, We began adopting the new Hibernation API in projects, and I have an idea for an improvement of the APIs it has. Currently, the serializeAttachment and deserializeAttachment methods are provi...
Clients are only expected to subscribe to 3 or 4 topics at a time, so the limit of 10 wouldn't be a problem.
And I'm not too surprised that it's a complex implementation. After all, that's why I would prefer that to using serialized attachments for performance reasons.
It's not hugely important for me, but I thought I'd ask. Thanks for replying.
oh look that's my gh issue ๐
we ended up solving that with an override list that is stored in the attachment, since for our use case, tags only need to be "deleted", so we use the attachment as a filter after getting all that match a tag ๐ฏ