Code Monkey home page Code Monkey logo

Comments (12)

fiorix avatar fiorix commented on July 28, 2024

I've been trying to fix this issue. However, it will require many changes before it can be fixed because of the nature of Twisted.
Still trying to minimize the impact on the way it works.

from cyclone.

zyyang avatar zyyang commented on July 28, 2024

I got this problem because I have a global ui mobule which requires db access.
I was trying to walk around this by injecting RequestHandler's "prepare", "render_string"..., but none of these function supports "inlineCallbacks". Still can't find a way.
I will really appreciate it if you kindly offer some suggestions.

from cyclone.

fiorix avatar fiorix commented on July 28, 2024

Yes, as I mentioned before, I've been trying many different solutions to this problem. What I don't want to do is to change the API in such a way that "render_string" return a deferred. That would require "yield self.render(..)", or even "text = yield self.render_string(..)".
I still don't have a final solution for this...

from cyclone.

zyyang avatar zyyang commented on July 28, 2024

here is my walk around:
since my project has several ui modules that appear all across the website, I have to do some db access works in the ui module.
I just:

  1. write another handler that renders data which should have been rendered by ui module.
  2. load data from the handler using ajax, and append it to the ui module html after page is loaded..
  3. for other pages that need this ui module, just include the ajax script to them.
    it is not a good idea but works for now.

from cyclone.

rmax avatar rmax commented on July 28, 2024

Hi fiorix,

I added deferred support for templates, you can find the modified module here:
https://github.com/darkrho/txrho/blob/master/txrho/web.py#L245

It requires a new template node that you can find in templates.py source.

Usage example: {% yield modules.AsyncModule() %}

Didn't had time to document that feature yet :(
In my txrho repository I added other modifications that return the control to the reactor more often.

Regards,

from cyclone.

zyyang avatar zyyang commented on July 28, 2024

that's brilliant, darkrho.

from cyclone.

fiorix avatar fiorix commented on July 28, 2024

@darkrho can you get it merged into the current code base? would be great to have it before the release of cyclone 1.0

from cyclone.

rmax avatar rmax commented on July 28, 2024

@fiorix I would be able to cleanup the code and merge with the current database the last week of this month. Let me know if it's within the 1.0 release timeline.

from cyclone.

fiorix avatar fiorix commented on July 28, 2024

@darkrho yeah that works for me, thanks!

from cyclone.

nkvoll avatar nkvoll commented on July 28, 2024

Any updates on this? :)

from cyclone.

fiorix avatar fiorix commented on July 28, 2024

not yet

On 2012-04-26, at 4:10 AM, Njal Karevoll wrote:

Any updates on this? :)


Reply to this email directly or view it on GitHub:
#21 (comment)

Ship, ahoy! Hast seen the White Whale?

  • Cap'n Ahab

from cyclone.

fiorix avatar fiorix commented on July 28, 2024

This require too many changes to the rendering structure. Honestly, I don't think there's an easy way to implement for now.
Please reopen this ticket whenever needed and we can put it on the table once again.

from cyclone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.