Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (25 sloc) 0.84 kB
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
#import backend.spomsky
import time
class Router:
def __init__(self):
self.backends = []
self.apps = []
def register_app(self, app):
self.apps.append(app)
def add_backend(self, backend):
self.backends.append(backend)
def serve_forever(self):
# if no backends have been set up, add one with
# no arguments, for local dev and debugging
if len(self.backends) == 0:
self.add_backend(backend.spomsky.Client())
# dump some debug info for now
print "BACKENDS: %r" % (self.backends)
print "APPS: %r" % (self.apps)
print "SERVING FOREVER..."
# block forever! TODO: replace this
# with a thread for each backend
while(True):
time.sleep(1)
Jump to Line
Something went wrong with that request. Please try again.