Klaus Demo ~jonashaag/bjoern / 261d3a6 tests / huge.py
261d3a6

Tree @261d3a6 (Download .tar.gz)

huge.py @261d3a6raw · history · blame

N = 1024
CHUNK = 'a' * 1024
DATA_LEN = N * len(CHUNK)

class _iter(object):
    def __iter__(self):
        for i in xrange(N):
            yield CHUNK

def app(e, s):
    s('200 ok', [('Content-Length', str(DATA_LEN))])
    return _iter()

import bjoern
bjoern.run(app, '0.0.0.0', 8080)