Add stream for CompositionView
This commit is contained in:
@@ -352,4 +352,4 @@ class Router:
|
||||
:return: bool
|
||||
"""
|
||||
handler = self.get(request)[0]
|
||||
return handler.is_stream
|
||||
return hasattr(handler, 'is_stream') and handler.is_stream
|
||||
|
||||
@@ -83,7 +83,8 @@ class CompositionView:
|
||||
def __init__(self):
|
||||
self.handlers = {}
|
||||
|
||||
def add(self, methods, handler):
|
||||
def add(self, methods, handler, stream=False):
|
||||
handler.is_stream = stream
|
||||
for method in methods:
|
||||
if method not in HTTP_METHODS:
|
||||
raise InvalidUsage(
|
||||
|
||||
Reference in New Issue
Block a user