All pastes #965010 Raw Edit

Something

public python v1 · immutable
#965010 ·published 2008-03-31 18:35 UTC
rendered paste body
# the CherryPy server code:#!/usr/bin/env pythonimport random, stringimport cherrypyfrom cherrypy import expose, toolsconf = {"global" : {"server.socket_port" : 8080,                    "server.socket_host" : "0.0.0.0"}}class Query(object):    @expose    def foo(self):        qux = ''.join(random.choice(string.lowercase) for i in xrange(5)) + '\n'        self.qux = qux        return qux    @expose    def bar(self):        return self.quxcherrypy.quickstart(Query(), config=conf)$ for i in {1..20}; do curl http://localhost:8080/foo >> res.txt & curl http://localhost:8080/bar >> res.txt; echo '-----' >> res.txt; done$ cat res.txt wutbdwutbd-----juzggjuzgg-----gfchlgfchl-----yklzfyklzf-----cqxqccqxqc-----cqxqc-----gsbxigsbxi-----jzlypchslmchslm-----plllmplllm-----plllm-----lkoaclkoachlssb-----hlssbhaiqi-----ksdlg-----ksdlg-----ksdlgkgaejkgaej-----kqocbkqocb-----zlrvvshcjmshcjm-----shcjm-----crani-----pfyimcranifjlacfjlac-----