コード例 #1
0
ファイル: app.py プロジェクト: roadsync/falcon
    def add_sink(self, sink, prefix=r'/'):
        if not iscoroutinefunction(sink) and is_python_func(sink):
            if _should_wrap_non_coroutines():
                sink = wrap_sync_to_async(sink)
            else:
                raise CompatibilityError(
                    'The sink method must be an awaitable coroutine function '
                    'in order to be used safely with an ASGI app.')

        super().add_sink(sink, prefix=prefix)
コード例 #2
0
ファイル: compiled.py プロジェクト: hzdwang/falcon-1
 def let(responder=responder):
     method_map[method] = wrap_sync_to_async(responder)