deferred and macros
William Waites <[email protected]> Tue, 21 Dec 2004 11:02:01 -0500
| Newsgroups | gmane.comp.web.wiki.moin.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I guess I will have some trouble articulating this question.
What I would like to be able to do is, running MoinMoin inside
Twisted, write a macro that looks like this:
def execute(macro, args):
from twisted.internet import defer
return defer.succeed("Bonjour le monde!")
of course such a thing could get arbitrarily complex, but this
is the simplest example to illustrate the point.
Right now (with 1.3), this will return an error complaining that
the deferred is an instance and not a string. Sensible enough,
because it's true.
However having macros able to return deferreds is useful since
it makes it possible to make many calls to the twisted framework
from within MoinMoin. But it is difficult because right now the
MoinMoin architecture expects calls like this to be synchronous
and changing that would imply creating a dependency on twisted
-- MoinMoin would no longer run standalone or cgi, or at a minimum
would have an internal dependency on twisted for handling deferreds.
So I'm not sure what my question is. It would be nice to be able
to do things like this, but it does not seem possible without
big changes to MoinMoin and the introduction of undesireable
dependencies.
Does anyone see a way out?
Cheers,
-w
--
... a poem about a haircut! But lofty, noble, tragic, timeless,
full of love, treachery, retribution, quiet heroism in the face
of certain doom! Six lines, cleverly rhymed, and every word
beginning with the letter s!
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/