Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel registers subscriptions on the fiber, this ties subscriptions to lifetime of the fiber instead of the channel #13

Open
GoogleCodeExporter opened this issue Dec 14, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Not sure if this is an issue or just different ways of using Retlang but I 
wanted to bring it to your attention.

Previous to the introduction of ISubscriptionRegistry and related changes, any 
subscriptions to a Channel would only be held by the Channel. We relied on this 
behavior to avoid having to unsubscribe/dispose any subscriptions to a Channel 
as the lifetime of the Channel and the objects that were subscribing to it were 
generally tied together.

With the current behavior all subscriptions to a Channel are registered on the 
fiber (via ISubscriptionsRegistry) and so they will be held for the lifetime of 
the fiber or until we unsubscribe/dispose them.

Obviously, the answer is to ensure we unsubscribe/dispose all our subscriptions 
but it was very convenient for us to not have to.

I've worked around the problem by simply removing the RegesterSubscription line 
from Channel.

Original issue reported on code.google.com by leafgarland on 16 May 2011 at 11:45

@GoogleCodeExporter
Copy link
Author

The reason this was added was so that subscriptions are properly cleaned up 
with a Fiber is disposed.  Before this change, it was not the case.

However, I can see how this can be more work, at least in the case of temporary 
channels.  In the future I will take a look and see if there is a cleaner way.

Original comment by graham.m...@gmail.com on 17 May 2011 at 4:23

  • Changed state: Accepted
  • Added labels: Type-Task
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

I'm planing to use temporary channels for streaming fileIO and probably socket 
stream.
"lifetime of the Channel and the objects that were subscribing to it were 
generally tied together"- will be appreciated I guess. Otherwise, I need to 
insure to clean any unused channels together with file handlers etc. ?

Original comment by pip...@gmail.com on 15 Feb 2012 at 2:24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant