-
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
177 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import inspect | ||
from robyn.robyn import FunctionType | ||
|
||
def get_function_type(handler): | ||
# as this is the most likely case, short circuit for it | ||
is_sync = ( | ||
not asyncio.iscoroutinefunction(handler) and | ||
not inspect.isgeneratorfunction(handler) and | ||
not inpsect.isasyncgenfunction(handler) | ||
) | ||
if is_sync: | ||
return FunctionType.SYNC | ||
if inspect.iscoroutinefunction(handler): return FunctionType.ASYNC | ||
if inspect.isasyncgenfunction(handler): return FunctionType.ASYNCGENERATOR | ||
if inspect.isgeneratorfunction(handler): return FunctionType.SYNCGENERATOR | ||
|
||
|
||
class FunctionInfoFactory: | ||
"""Used for constructing FunctionInfo and wrapper""" | ||
def create_route(handler): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.