Permalink
Browse files

updating README, setup.py version number

  • Loading branch information...
steiza committed Mar 5, 2012
1 parent 801b24b commit 11ebcd7146025587737b0d037773d99ed9f67d2a
Showing with 12 additions and 3 deletions.
  1. +11 −2 README
  2. +1 −1 setup.py
View
13 README
@@ -6,8 +6,8 @@ dispatch with routes in your twisted.web application.
Usage:
- from twisted.internet import reactor
- from twisted.web.server import Site
+ from twisted.internet import reactor, task
+ from twisted.web.server import Site, NOT_DONE_YET
# Create a Controller
class Controller(object):
@@ -21,6 +21,12 @@ Usage:
def post_data(self, request):
return '<html><body>OK</body></html>'
+ def deferred_example(self, request):
+ request.write('<html><body>Wait a tic...</body></html>')
+ task.deferLater(reactor, 5, lambda: request.finish())
+
+ return NOT_DONE_YET
+
c = Controller()
dispatcher = Dispatcher()
@@ -33,6 +39,9 @@ Usage:
dispatcher.connect(name='data', route='/data', controller=c,
action='post_data', conditions=dict(method=['POST']))
+ dispatcher.connect(name='deferred_example', route='/wait', controller=c,
+ action='deferred_example')
+
factory = Site(dispatcher)
reactor.listenTCP(8000, factory)
reactor.run()
View
@@ -1,7 +1,7 @@
from setuptools import setup
setup(name='txroutes',
- version='0.0.2',
+ version='0.0.3',
author='Zach Steindler',
author_email='steiza@coffeehousecoders.org',
url='http://github.com/steiza/txroutes',

0 comments on commit 11ebcd7

Please sign in to comment.