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

Dispose on MessageSubject subscription should close socket #9

Open
mbonneau opened this issue Apr 3, 2017 · 1 comment
Open

Dispose on MessageSubject subscription should close socket #9

mbonneau opened this issue Apr 3, 2017 · 1 comment

Comments

@mbonneau
Copy link
Member

mbonneau commented Apr 3, 2017

With the following:

$client = new \Rx\Websocket\Client('ws://127.0.0.1:9090/ws');

$client->subscribe(function (MessageSubject $ms) {
    $disp = $ms->subscribe();

    addTimer(2, function () use ($disp) {
        echo "Dispose...\n";
        $disp->dispose();
    });
});

The websocket should close when there are no more subscriptions.

@WyriHaximus
Copy link
Contributor

I have something that might help with this, will file a PR when I'm on the train to work 👍

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

No branches or pull requests

2 participants