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

Application router #36

Open
practicingruby opened this issue Feb 27, 2012 · 4 comments
Open

Application router #36

practicingruby opened this issue Feb 27, 2012 · 4 comments
Labels

Comments

@practicingruby
Copy link
Contributor

A lot of complicated issues arise from having only a single linear path to mount applications in. We need either a horizontal mapping at the top level, or a composite application router that could be dropped anywhere within the linear chain.

Top level horizontal routing:

request -> router ---> app_a---> response (if matched)
                  |
                  ---> app_b---> response (if matched)
                  |
                  ---> app_c---> response (if matched)

Composable router application. This seems more promising and logically easier to think through, but retains the "one request, at most one response" limitation. Still have not figured out whether that is going to really harm Newman's usability for scenarios we're interested in.

request --> (pre apps) -> router_app--> component_app_a----> (post apps) -> response
                                      |                    |
                                      > component_app_b----^
                                      |                    |
                                      > component_app_c----^
@practicingruby
Copy link
Contributor Author

@ericgj I want to try the "Router as an application composed of other applications" approach. What do you think?

@practicingruby
Copy link
Contributor Author

Note... Newman::Router needn't necessarily be a Newman::Application, just something that responds to call()

@ericgj
Copy link
Contributor

ericgj commented Feb 27, 2012

Yeah, the composable was what I was thinking to try first, it doesn't break the way the server works now since it's just another app. But not sure this is a priority until we get some more real multi-app scenarios going.

On that note, I did put up a semi-working scheduler app if you want to take a look. It's designed to work with a mailing-list app downstream, as a kind of mailing-list "add-on". Mailing-list archives functionality could be similarly done - as a separate app. But there are various complications about sharing pstore and settings files among apps.

@practicingruby
Copy link
Contributor Author

I want to address the router simply because I feel like it's one of those problems that if there isn't a good solution in the framework for it, there will be ten different hacks downstream. In general I definitely want to take a use-case driven design, but I think this qualifies as one of the foundational features.

I'll look into whether these ideas could map onto scheduler or archiving. I'm thinking this router feature is one to consider for 0.4.0, as it's important but not urgent. So we have at least a few more weeks to think about it.

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