Refresh the inventory on the user's queue, which the client joins by connecting
CI / build (push) Successful in 25s
CI / build (push) Successful in 25s
The client never subscribes to its user queue; the proxy now follows every IMQ connection and the signed-in account (from the login answer), and delivers the refresh event on /user/<id>. Checked live: removing a product from the library on the hub reloads the client's inventory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
ca7a86ce89
commit
5b4e44c4e7
5 files changed
+34
-11
No files matched your search
@@ -74,6 +74,7 @@ func (s *Server) serveConnect(w http.ResponseWriter, r *http.Request) {
|
||||
c := &IMQConn{ID: id, w: toClient}
|
||||
down.watcher, down.conn = w, c
|
||||
up.watcher, up.conn = w, c
|
||||
w.Opened(c)
|
||||
defer w.Closed(c)
|
||||
}
|
||||
// IMQ is a session: when either side closes, it's over, so both connections close.
|
||||
@@ -111,6 +112,8 @@ type IMQFilter interface {
|
||||
// messages the gateway delivers (which it can change), and it can deliver messages of its own.
|
||||
type IMQWatcher interface {
|
||||
IMQFilter
|
||||
// Opened: the client opened an IMQ connection (its user queue comes with it, without a subscription).
|
||||
Opened(c *IMQConn)
|
||||
// Subscribed and Unsubscribed see the client's subscriptions on a connection.
|
||||
Subscribed(c *IMQConn, queues []string)
|
||||
Unsubscribed(c *IMQConn, queues []string)
|
||||
|
||||
Reference in new issue
Block a user