[Moin-devel] deferred and macros

William Waites ww at groovy.net
Tue Dec 21 08:03:03 EST 2004


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!




More information about the Moin-devel mailing list