# Path: stator/http.py
#     UNICODE_TYPE = unicode
#     UNICODE_TYPE = str
# class CantBindAddress(Exception):
# class HttpRequest(Socket):
# class Http(Socket):
#     def __init__(self, id, dic):
#     def reply(self, status, headers, body):
#     def parse_message(self, input):
#     def __init__(self, host, port):
# 
# Path: stator/loop.py
#     INT_TYPES = (int, long)
#     INT_TYPES = int
# TABLE = SocketTable()
# class Socket(object):
# class SocketTable(object):
#     def __init__(self, id):
#     def close(self):
#     def parse_message(self, input):
#     def __repr__(self):
#     def __init__(self):
#     def add(self, item):
#     def get(self, id):
#     def remove(self, id):
# def parse_message(sock_id, buf, buf_len):
# def no_message():
# def blocking_io():
# def events():
# 
# Path: stator/aio.py
# LOOP = None
# FUTURES = {}
#     LOOP = loop
# class Redis(Socket):
#     def __init__(self, *, host='127.0.0.1', port=6379, db=0):
#     def execute(self, args):
#     def parse_message(self, input):
# def dispatch_messages(loop, callback):
# def start(callback, *, loop=None):


import asyncio
from stator import http, loop, aio


@asyncio.coroutine
def dispatch(loop, req):
    req.reply(
        [200, u"OK"],
        {u"Content-Type": b"text/html"},
        b"Hello World")


def main():
    loop = asyncio.get_event_loop()

    sock = http.Http('0.0.0.0', 3000)

# Path: stator/http.py
#     UNICODE_TYPE = unicode
#     UNICODE_TYPE = str
# class CantBindAddress(Exception):
# class HttpRequest(Socket):
# class Http(Socket):
#     def __init__(self, id, dic):
#     def reply(self, status, headers, body):
#     def parse_message(self, input):
#     def __init__(self, host, port):
# 
# Path: stator/loop.py
#     INT_TYPES = (int, long)
#     INT_TYPES = int
# TABLE = SocketTable()
# class Socket(object):
# class SocketTable(object):
#     def __init__(self, id):
#     def close(self):
#     def parse_message(self, input):
#     def __repr__(self):
#     def __init__(self):
#     def add(self, item):
#     def get(self, id):
#     def remove(self, id):
# def parse_message(sock_id, buf, buf_len):
# def no_message():
# def blocking_io():
# def events():
# 
# Path: stator/aio.py
# LOOP = None
# FUTURES = {}
#     LOOP = loop
# class Redis(Socket):
#     def __init__(self, *, host='127.0.0.1', port=6379, db=0):
#     def execute(self, args):
#     def parse_message(self, input):
# def dispatch_messages(loop, callback):
# def start(callback, *, loop=None):


# Path: examples/http_asyncio.py
import asyncio
from stator import http, loop, aio



@asyncio.coroutine
def dispatch(loop, req):
    req.reply(
        [200, u"OK"],
        {u"Content-Type": b"text/html"},
        b"Hello World")


def main():
    loop = asyncio.get_event_loop()

    sock = http.Http('0.0.0.0', 3000)

    aio.start(dispatch, loop=loop)