Skip to content

Instantly share code, notes, and snippets.

@squiddy
Created March 22, 2011 22:26
Show Gist options
  • Save squiddy/882221 to your computer and use it in GitHub Desktop.
Save squiddy/882221 to your computer and use it in GitHub Desktop.
Windows twisted amp bug
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