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

Response filters not being called #14

Open
writeson opened this issue Sep 16, 2013 · 4 comments
Open

Response filters not being called #14

writeson opened this issue Sep 16, 2013 · 4 comments

Comments

@writeson
Copy link

I'm using Corepost (which is great by the way) to build a Twisted application for a REST API. I coded up a response filter and passed it to to the RESTResource, but the filter is not being called. Following the code in a debugger it gets to routing.py and the getResponse() method, but it's bailing out at the "handle deferreds natively" if statement. Is there a way to get this to pass the response through the response filter I've set up?

@jacek99
Copy link
Owner

jacek99 commented Sep 16, 2013

Hi, honestly I do not know.

I coded CorePost as an experiment in my previous job and during the performance tests the equivalent Java Dropwizard version proved superior in nearly ever way (including CPU usage).

As such I really do not do much in Python anything (actually nothing these days) and do most of my work during high perf realtime REST server apps in Java and Dropwizard.

So if someone is interested in taking over CorePost and maintaining or forking it, I am very open to this.

Sorry, I thought I'd rather be honest about what is the current status of the project :-/

@jacek99
Copy link
Owner

jacek99 commented Sep 16, 2013

I do remember having BDDs though that test both filters, so try and dig through the test apps in the BDD folder to see what I did there....

@writeson
Copy link
Author

jacek99,

Sorry to hear the project state is where it is, I think it's a very useful tool for Python/Twisted. I don't know much about Java, so I'm in the opposite boat. :)

It looks like the method routing.__finishedDeferred(val, request) is the place to put a call to get the response filter to fire. I'll also look at the BBDs you mention and see if I can see how you tested both filters.

Thanks for your help!

Doug

@writeson
Copy link
Author

Hi jacek99,

Looked at the test code and it only tests the response filters in the case where the get/post/whatever function is not decorated with @defer.inlineCallbacks unfortunately. I'm working on ways around this at the moment...

Doug

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

No branches or pull requests

2 participants