[Twisted-web] Ampoule deferToAMPProcess confusion

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Fri Oct 14 20:49:02 EDT 2011

On 14 Oct, 09:41 pm, jacek99 at gmail.com wrote:
>Can someone point me to some good docs on Ampoule deferToAMPProcess?
>I am trying in vain to get the simplest possible example working, with 
>from ampoule import deferToAMPProcess, util
>from twisted.internet import reactor, defer
>def test():
>    return "TEST"
>def main(args):
>    @defer.inlineCallbacks
>    def _run():
>        val = yield deferToAMPProcess(test)
>        print val
>        reactor.stop()
>    reactor.callLater(1, _run)
>    reactor.run()
>exceptions.AttributeError: 'str' object has no attribute '_doCommand'
>I've tried different combinations, returnd Deferreds from the test()
>function, inline callbacks with defer.returnValue().
>Can't get it to work.
>Looks like I am not the only one:

The test suite exercises this API:


Note in particular that it takes a Command, not a function.


More information about the Twisted-web mailing list