diff --git a/misc/bench-bar-graph-asgi.png b/misc/bench-bar-graph-asgi.png index 82ff921..f1bc29d 100644 Binary files a/misc/bench-bar-graph-asgi.png and b/misc/bench-bar-graph-asgi.png differ diff --git a/misc/bench-bar-graph-general.png b/misc/bench-bar-graph-general.png index 8799942..2e898c7 100644 Binary files a/misc/bench-bar-graph-general.png and b/misc/bench-bar-graph-general.png differ diff --git a/misc/bench-bar-graph-wsgi.png b/misc/bench-bar-graph-wsgi.png index e905b22..5755334 100644 Binary files a/misc/bench-bar-graph-wsgi.png and b/misc/bench-bar-graph-wsgi.png differ diff --git a/src/tests.py b/src/tests.py index 3e94066..af60a13 100644 --- a/src/tests.py +++ b/src/tests.py @@ -1,89 +1,26 @@ -from socketify.template import * +from socketify import App -# https://github.com/chtd/psycopg2cffi/ -# https://github.com/tlocke/pg8000 -# https://www.psycopg.org/docs/advanced.html#asynchronous-support (works in cffi version too) -# https://github.com/sass/libsass-python +app = App() -# @memo() # generate an static string after first execution aka skipping re-rendering when props are unchanged -# def title(message): -# return h1(message, classes="title-light") +def extension(request, response, ws): -# @memo(maxsize=128) -def htemplate(message, left_message, right_message): + @request.method + async def get_user(self): + token = self.get_header("token") + self.token = token + return { "name": "Test" } if token else { "name", "Anonymous" } - return ( - h1(message), - span( - children=( - span(left_message, classes=("text-light", "align-left")), - span(right_message, classes=("text-light", "align-right")), - ), - ), - ) + @request.method + async def get_cart(self): + return [{ "quantity": 10, "name": "T-Shirt" }] + request.property("token", None) -# -# -#
-# -# -# -#