Esempio n. 1
0
 def async_file(self):
     file_path = self.field("path", None)
     thread = self.field("thread", False, cast=bool)
     type, _encoding = mimetypes.guess_type(file_path, strict=True)
     type = type or "application/octet-stream"
     self.request.content_type = type
     yield -1
     yield appier.ensure_async(self.read_file,
                               args=[file_path],
                               thread=thread)
Esempio n. 2
0
 def callable(self):
     yield -1
     yield "before\n"
     yield appier.ensure_async(lambda: time.sleep(30.0))
     yield "after\n"
Esempio n. 3
0
 def hello(self):
     yield -1
     yield "before\n"
     yield appier.ensure_async(self.handler)
     yield "after\n"