I have been running some tests to check some issue and have seen that
notifyFinish is not being called in 16.4.1

This is on Windows 10 using python 2.7.12

Checking back it  is not called 16.3.0 but is in 16.2.0

The test uses some sample code from Twisted web in 60 seconds that sets a
timer to allow the browser to halt the request by using Escape and make
notifyFinish  get called.

Before I did anything else I thought I would check and see if anyone else
was seeing this behaviour.

The code I am using is below:

from twisted.web.resource import Resource
from twisted.web.server import  Site, NOT_DONE_YET
from twisted.internet import reactor

class DelayedResource(Resource):
    def _delayedRender(self, request):
        print 'SEND RESPONSE'
        request.write("Sorry to keep you waiting.")

    def _responseFailed(self, failure, call):
        print 'RESPONSE FAILED', failure

    def render_GET(self, request):
        call = reactor.callLater(10, self._delayedRender, request)
        request.notifyFinish().addErrback(self._responseFailed, call)
        return NOT_DONE_YET

resource = Resource()
print 'RESOURCE', resource
resource.putChild("logme", DelayedResource())
factory = Site(resource)

print 'FACTORY', factory
reactor.listenTCP(8080, factory)

*John Aherne*

*www.rocs.co.uk <http://www.rocs.co.uk>*
020 7223 7567
Twisted-Python mailing list

Reply via email to