Should channel subscription be disposed?
Options
BesoC
✭✭
Hi
Suppose there is a ClientPeer class that has a publish Channel. Some object - call it Lobby - is subscribed to publish channels of all ClientPeers with its poolfiber.
Poolfiber's NumSubscriptions increase when Lobby subscribes to new ClentPeer object's channel. However NumSubscriptions does not decrease when some ClentPeer object disposes.
Do you recommend to dispose corresponding subscription in Lobby when some ClientPeer object leaves or it will not affect performance and can be ignored?
Thanks
Suppose there is a ClientPeer class that has a publish Channel. Some object - call it Lobby - is subscribed to publish channels of all ClientPeers with its poolfiber.
Poolfiber's NumSubscriptions increase when Lobby subscribes to new ClentPeer object's channel. However NumSubscriptions does not decrease when some ClentPeer object disposes.
Do you recommend to dispose corresponding subscription in Lobby when some ClientPeer object leaves or it will not affect performance and can be ignored?
Thanks
0
Best Answers
-
Hi, BesoC
if you use method like RegisterSubscription, you also need use DeregisterSubscription. if my assuption is wrong you need to provide a sampe
best,
ilya5 -
you may download sources from here to understand better what is going on underneath.
at least you will have memory leak and performance degradation, right? at most you may have exceptions.
best,
ilya5
Answers
-
Hi, BesoC
if you use method like RegisterSubscription, you also need use DeregisterSubscription. if my assuption is wrong you need to provide a sampe
best,
ilya5 -
Thanks for the answer, Ilya.
If subscriptions will not be deregistered, what will it cause? memory leaks? higher cpu usage? exceptions?0 -
you may download sources from here to understand better what is going on underneath.
at least you will have memory leak and performance degradation, right? at most you may have exceptions.
best,
ilya5 -
Clear. Thank you, Ilya0