GithubHelp home page GithubHelp logo

Comments (5)

lukeredpath avatar lukeredpath commented on July 24, 2024

Hi Tim. I'll take a look into this. FWIW, if you compile the ARC version of the library as a static library (there are precompiled downloads available) you can use it in your non ARC project without any problems.

from libpusher.

tim17x6 avatar tim17x6 commented on July 24, 2024

I tried to destroy unsubscribed channels by removing them from the 'channels' dictionary in the PTPusher class. This did not seem to work since the PTPusher 'dispatcher' object still held a reference to all channels. This reference was established when each channel was bound to the 'pusher_internal:subscription_succeeded' and 'subscription_error' events. Since these events are never unbound, channel objects are never released - event after they are unsubscribed.

I would like to be able to subscribed and unsubscribe from channels, and then clear the unsubscribed channels from memory. In order to do this, it seems that channels need to be able to cleanly unbind from all internal and external events. It seems that this would be pretty standard functionality for most apps that use push messaging.

Please let me know if I am thinking about this incorrectly or doing something wrong. I would be grateful for any guidance.

Thanks,
Tim

from libpusher.

tim17x6 avatar tim17x6 commented on July 24, 2024

I think I found a bug related to this issue. In PTPusherChannel.m method initWithName:pusher:

These lines:
[pusher bindToEventNamed:@"pusher_internal:subscription_succeeded"
target:self action:@selector(handleSubscribeEvent:)];
[pusher bindToEventNamed:@"subscription_error"
target:self action:@selector(handleSubscribeErrorEvent:)];

Should be.
[self bindToEventNamed:@"pusher_internal:subscription_succeeded"
target:self action:@selector(handleSubscribeEvent:)];
[self bindToEventNamed:@"subscription_error"
target:self action:@selector(handleSubscribeErrorEvent:)];

This fixes some problems with reconnecting to multiple channels on reconnection.

from libpusher.

lukeredpath avatar lukeredpath commented on July 24, 2024

@tim17x6 could you please try the use-socketrocket-backend branch and see if this fixes the problem for you?

from libpusher.

lukeredpath avatar lukeredpath commented on July 24, 2024

This should be fixed in 1.2, which I released today.

from libpusher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.