jacek99 / corepost

REST micro-framework for Python Twisted with multi-core support
http://jacek99.github.com/corepost/
Other
47 stars 15 forks source link

Response filters not being called #14

Open writeson opened 11 years ago

writeson commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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