Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Application Multiplexer #844

Merged
merged 56 commits into from
Feb 25, 2014
Merged

Conversation

vgeddes
Copy link
Contributor

@vgeddes vgeddes commented Feb 4, 2014

This is to track a special router which links various Go USSD apps to a single starcode.

@ghost ghost assigned vgeddes Jan 31, 2014
@@ -136,6 +136,10 @@ def get_router_definition(router_type, router=None):
'namespace': 'keyword',
'display_name': 'Keyword',
},
'go.routers.app_multiplexer': {
'namespace': 'application_multiplexer',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably best if the namespace matches the module name, i.e. app_multiplexer. We don't do that in a few places but those are all places which we want to get rid of eventually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namespace value needs to change to match the module name.

@hodgestar
Copy link
Contributor

General layout looks good. :)

@@ -24,6 +24,8 @@
{% for edit_form in edit_forms %}
<fieldset>
{{ edit_form|crispy }}
<!-- TODO: style this correctly -->
<strong>{{ edit_form.non_form_errors }}</strong>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be above the form and probably protected with a block that checks that non_form_errors exists (i.e. the form is a formset) and a note that this is a crispy forms bug (I've filed django-crispy-forms/django-crispy-forms#298 for it).

@hodgestar
Copy link
Contributor

Review done for now. I would work on ApplicationMultiplexer in vumi_app.py since that's were the core functionality lives.

response = self.client.get(rtr_helper.get_view_url('edit'))
self.assertEqual(response.status_code, 200)

def test_user_input_good(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably have a corresponding test_user_input_bad() or something.

@hodgestar
Copy link
Contributor

After discussion with @jerith I've been convinced that a dynamic session manager that uses the the name of the application worker combined with the router key as the key prefix is better than a static session manager. Apologies for the running around @vgeddes.

# Static configuration
session_expiry = ConfigInt(
"Maximum amount of time in seconds to keep session data around",
default=1800, static=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Half an hour is a very long default session expiry. Maybe change this to 5 minutes? We update the expiry every time we update the session, so it would expire 5 minutes after the last change instead of 5 minutes after the initial creation.

@jerith
Copy link
Member

jerith commented Feb 24, 2014

Finished this review pass. There are a whole pile of minor things (some of which probably slipped through previous review passes) and a couple of less minor ones.

config.redis_manager,
key_prefix=self.worker_name,
max_session_length=config.session_expiry
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to have the router key in the key_prefix. Something like ':'.join([self.worker_name, config.router.key]) should do the trick.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I've pushed a commit which fixes that.

@jerith
Copy link
Member

jerith commented Feb 25, 2014

Pointer to #844 (comment) which is hidden behind an "outdated diff" line.

@jerith
Copy link
Member

jerith commented Feb 25, 2014

👍 🎆 \o/

vgeddes added a commit that referenced this pull request Feb 25, 2014
…ultiplexer

Merge in the application multiplexing router
@vgeddes vgeddes merged commit e3d6eb4 into develop Feb 25, 2014
@vgeddes vgeddes deleted the feature/issue-844-application-multiplexer branch February 25, 2014 14:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants