Open amokio opened 11 months ago
I believe only one subscription per Client is supported before, and only work for single client.
example:
client1 -> subscribe -> test {id: 1, method: "subscription",…} client1 -> subscribe -> test2 {id: 2, method: "subscription",…} client2 -> subscribe -> test {id: 1, method: "subscription",…} client2 -> subscribe -> test {id: 2, method: "subscription",…}
Client2 will override Client1 Unsubscribable object. observers { 1: Unsubscribable, 2: Unsubscribable }, Here may have memory leak and the observer still listener on event emitter.
proposed data structure :
{ "[socket.id]": { "[id]": Unsubscribable } }
I believe only one subscription per Client is supported before, and only work for single client.
example:
client1 -> subscribe -> test {id: 1, method: "subscription",…} client1 -> subscribe -> test2 {id: 2, method: "subscription",…} client2 -> subscribe -> test {id: 1, method: "subscription",…} client2 -> subscribe -> test {id: 2, method: "subscription",…}
Client2 will override Client1 Unsubscribable object. observers { 1: Unsubscribable, 2: Unsubscribable }, Here may have memory leak and the observer still listener on event emitter.
proposed data structure :