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

Change sever.sockets behavior? #71

Open
philipn opened this issue Aug 1, 2012 · 2 comments
Open

Change sever.sockets behavior? #71

philipn opened this issue Aug 1, 2012 · 2 comments
Milestone

Comments

@philipn
Copy link
Contributor

philipn commented Aug 1, 2012

I'm wondering if it would be better to make server.sockets an iterable of Socket objects (rather than a dict of sessid: sockets) and move the current server.sockets to server._sockets. This would clean up some code:

def broadcast_msg(server, tweet):
    for socket in server.sockets.values():
        if '/tweets' in socket:
            socket['/tweets'].emit('tweet', tweet)

becomes

def broadcast_msg(server, tweet):
    for socket in server.sockets:
        if '/tweets' in socket:
            socket['/tweets'].emit('tweet', tweet)
@sontek
Copy link
Collaborator

sontek commented Apr 13, 2013

@philipn This is a good idea :)

@abourget
Copy link
Owner

Good idea indeed. Let's make sure it's marked clearly in a "Breaking
changes" section of the changelogs.

Alexandre

On Sat, Apr 13, 2013 at 7:18 PM, John Anderson notifications@github.comwrote:

@philipn https://github.com/philipn This is a good idea :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/71#issuecomment-16342785
.

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

3 participants