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

feat(server): wait for frameworks to load via q.all() before starting server #1053

Closed
wants to merge 2 commits into from

Conversation

caitp
Copy link

@caitp caitp commented May 1, 2014

The API is to simply return a promise from a factory function, or use a promise as a value. The server will wait for the collection of frameworks to resolve before carrying on starting the server.

This is useful for when setup requires some asynchronous startup.

Currently, any Promise api which is interoperable with q may be used.

In addition to this feature, this CL also adds a set of callbacks to the server, via an object for the 3rd parameter. This is useful for test purposes, and enables the test case to run faster, by not waiting for the server to shut down via the second parameter.


There are some design decisions here which you might not like, such as using mockery rather than creating test fixtures outside of the test, or adding an object of callbacks to the server opener to help with testing it (it might be nice to have for other reasons, like bonus logging points or something). And of course, the main changes might be restructured in different ways too. So let me know if there are any issues with it @vojtajina, I suspect you were thinking the CL would be a bit smaller and change fewer things, but testing it seemed like a good thing to do.

Closes #851

caitp added 2 commits May 1, 2014 00:40
…odules

This module is nice, because it allows tests to mock modules which are required() by karma, such as
frameworks.
… server

The API is to simply return a promise from a factory function, or use a promise as a value. The server
will wait for the collection of frameworks to resolve before carrying on starting the server.

This is useful for when setup requires some asynchronous startup.

Currently, any Promise api which is interoperable with q may be used.

In addition to this feature, this CL also adds a set of callbacks to the server, via an object for the
3rd parameter. This is useful for test purposes, and enables the test case to run faster, by not waiting
for the server to shut down via the second parameter.

Closes karma-runner#851
@vojtajina
Copy link
Contributor

This sounds like a good feature. I need some more time to review it though.

@vojtajina vojtajina self-assigned this Jul 29, 2014
@PxlBuzzard
Copy link

Did you have enough time to review @vojtajina? I kid, but it would be nice to look into this again.

@caitp
Copy link
Author

caitp commented Apr 24, 2015

I don't think @vojtajina is going to be reviewing this --- and I can't actually even remember writing this. What was this for again?

@PxlBuzzard
Copy link

@caitp Your original issue was asking for async plugin support, and the discussion ended with a workaround and this PR.

@dignifiedquire
Copy link
Member

@caitp @PxlBuzzard is this still a feature that is needed?

I'm going to close this PR for now, as doesn't merge cleanly anymore. If you want to update it feel free to reopen it and I will review it in a more timely fashion.

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

Successfully merging this pull request may close these issues.

Support for asynchronous plugins
4 participants