Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

not using async def raise a SyntaxError #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cgte
Copy link

@cgte cgte commented Oct 25, 2018

When discovering the framework and copy pasting from the documentation about routing

from vibora import Vibora, JsonResponse, Request, Response
app = Vibora()

from vibora.cache import CacheEngine
from time import sleep

class YourCacheEngine(CacheEngine):
    async def get(self, request: Request):
        return self.cache.get(request.url)

    async def store(self, request: Request, response):
        self.cache[request.url] = response

@app.route('/simplecache', cache=YourCacheEngine(skip_hooks=True))
def simple():  #bug is here
    sleep(5)
    return Response(b'simple')


if __name__ == '__main__':
    app.run(host="127.0.0.1", port=8000)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants