Created
March 22, 2011 22:26
-
-
Save squiddy/882221 to your computer and use it in GitHub Desktop.
Windows twisted amp bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ampoule import child, util | |
from twisted.protocols import amp | |
class Test(amp.Command): | |
response = [("blocks", amp.String())] | |
class MyChild(child.AMPChild): | |
@Test.responder | |
def test(self): | |
return {"blocks": '\x00'*4073} | |
@util.mainpoint | |
def main(args): | |
import sys | |
from twisted.internet import reactor, defer | |
from twisted.python import log | |
#log.startLogging(sys.stdout) | |
from ampoule import pool | |
@defer.inlineCallbacks | |
def _run(): | |
pp = pool.ProcessPool(MyChild, min=1, max=1) | |
yield pp.start() | |
result = yield pp.doWork(Test) | |
#print result['blocks'] | |
print "You will not see this." | |
yield pp.stop() | |
reactor.stop() | |
reactor.callLater(1, _run) | |
reactor.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment