From a994ae5307aacf103a3adf5197c8bb608412df32 Mon Sep 17 00:00:00 2001 From: Sanskar Jethi Date: Mon, 14 Feb 2022 19:52:20 +0000 Subject: [PATCH] Add comments for decorator --- robyn/__init__.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/robyn/__init__.py b/robyn/__init__.py index b2ef394ac..936c0f826 100644 --- a/robyn/__init__.py +++ b/robyn/__init__.py @@ -91,8 +91,12 @@ def before_request(self, endpoint): :param endpoint [str]: [endpoint to server the route] """ + # This inner function is basically a wrapper arround the closure(decorator) + # being returned. + # It takes in a handler and converts it in into a closure + # and returns the arguments. + # Arguments are returned as they could be modified by the middlewares. def inner(handler): - # add handling for async functions async def async_inner_handler(*args): await handler(args) return args @@ -115,8 +119,12 @@ def after_request(self, endpoint): :param endpoint [str]: [endpoint to server the route] """ + # This inner function is basically a wrapper arround the closure(decorator) + # being returned. + # It takes in a handler and converts it in into a closure + # and returns the arguments. + # Arguments are returned as they could be modified by the middlewares. def inner(handler): - # add handling for async functions async def async_inner_handler(*args): await handler(args) return args