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

Cannot associate a SocketIO instance with more than one application #146

Closed
ericremoreynolds opened this issue Oct 7, 2015 · 4 comments
Closed
Labels
Milestone

Comments

@ericremoreynolds
Copy link

Hi Miguel,

While you work on the other issue I posted here is another question for you.

Are you planning on keeping this limitation or will v1 support multiple apps in future?

In our case this is creating a problem because our tests are failing since each one instantiates a new app.

Kind regards,

Eric

@miguelgrinberg
Copy link
Owner

Hmm. Let me think about this, it's tricky. Normally, extensions get the app from the app context, but with sockets there is no HTTP request, so no context either. Storing the app is a simple (and lazy, why not admit it) solution that works well, but creates this limitation.

@miguelgrinberg miguelgrinberg added this to the 1.0 milestone Oct 7, 2015
@ericremoreynolds
Copy link
Author

Sure I imagine it's not straightforward.

But it's hard to work around because the SocketIO instance serves two purposes - (a) to provide the declarative syntax to define handlers (common to all app instances) and (b) to actually do the work (specific to a single app instance).

I am obviously not super-acquainted with your code but I guess the two things could be somehow separated, e.g. the SocketIO instance takes care of (a) then init_app creates some internal object to do (b) behind the scenes.

@miguelgrinberg
Copy link
Owner

@ericremoreynolds could you please try release 1.0b2? I think you will be able to work with multiple app instances with this version. Thanks!

@ericremoreynolds
Copy link
Author

Looks good! Works with our code. Thanks.

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

No branches or pull requests

2 participants