Tornado 6.0 Documentation
convert_yielded(self.fetch_next_chunk()) while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = convert_yielded(self.fetch_next_chunk()) yield fetch_future = self.fetch_next_chunk() while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = self.fetch_next_chunk() yield self.flush() those methods are called, so the values are available during prepare. RequestHandler.data_received(chunk: bytes) → Optional[Awaitable[None]] [source] Implement this method to handle streamed request data0 码力 | 869 页 | 692.83 KB | 1 年前3Tornado 6.1 Documentation
convert_yielded(self.fetch_next_chunk()) while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = convert_yielded(self.fetch_next_chunk()) yield fetch_future = self.fetch_next_chunk() while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = self.fetch_next_chunk() yield self.flush() those methods are called, so the values are available during prepare. RequestHandler.data_received(chunk: bytes) → Optional[Awaitable[None]] [source] Implement this method to handle streamed request data0 码力 | 931 页 | 708.03 KB | 1 年前3Falcon v3.0.0-b1 Documentation
import io import os import uuid import mimetypes import falcon import msgpack class Resource: _CHUNK_SIZE_BYTES = 4096 # The resource object must now be initialized with a path used during POST while True: chunk = req.stream.read(self._CHUNK_SIZE_BYTES) if not chunk: break image_file.write(chunk) resp.status = falcon resp.status = falcon.HTTP_201 resp.location = '/images/' + name class ImageStore: _CHUNK_SIZE_BYTES = 4096 # Note the use of dependency injection for standard library # methods. We'll0 码力 | 1028 页 | 725.86 KB | 1 年前3Falcon v3.0.0 Documentation
import io import os import uuid import mimetypes import falcon import msgpack class Resource: _CHUNK_SIZE_BYTES = 4096 # The resource object must now be initialized with a path used during POST while True: chunk = req.stream.read(self._CHUNK_SIZE_BYTES) if not chunk: break image_file.write(chunk) resp.status = falcon resp.status = falcon.HTTP_201 resp.location = '/images/' + name class ImageStore: _CHUNK_SIZE_BYTES = 4096 # Note the use of dependency injection for standard library # methods. We'll0 码力 | 1055 页 | 739.30 KB | 1 年前3Falcon v3.0.1 Documentation
import io import os import uuid import mimetypes import falcon import msgpack class Resource: _CHUNK_SIZE_BYTES = 4096 # The resource object must now be initialized with a path used during POST while True: chunk = req.stream.read(self._CHUNK_SIZE_BYTES) if not chunk: break image_file.write(chunk) resp.status = falcon resp.status = falcon.HTTP_201 resp.location = '/images/' + name class ImageStore: _CHUNK_SIZE_BYTES = 4096 # Note the use of dependency injection for standard library # methods. We'll0 码力 | 1058 页 | 741.59 KB | 1 年前3Falcon v3.0.0-b2 Documentation
import io import os import uuid import mimetypes import falcon import msgpack class Resource: _CHUNK_SIZE_BYTES = 4096 # The resource object must now be initialized with a path used during POST while True: chunk = req.stream.read(self._CHUNK_SIZE_BYTES) if not chunk: break image_file.write(chunk) resp.status = falcon resp.status = falcon.HTTP_201 resp.location = '/images/' + name class ImageStore: _CHUNK_SIZE_BYTES = 4096 # Note the use of dependency injection for standard library # methods. We'll0 码力 | 1041 页 | 730.21 KB | 1 年前3Tornado 5.1 Documentation
convert_yielded(self.fetch_next_chunk()) while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = convert_yielded(self.fetch_next_chunk()) yield fetch_future = self.fetch_next_chunk() while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = self.fetch_next_chunk() yield self.flush() those methods are called, so the values are available during prepare. RequestHandler.data_received(chunk) Implement this method to handle streamed request data. Requires the stream_request_body decorator0 码力 | 359 页 | 347.32 KB | 1 年前3Tornado 4.5 Documentation
fetch_future = self.fetch_next_chunk() while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = self.fetch_next_chunk() yield self.flush() most usable with @gen.coroutine. If fetch_next_chunk() uses async def, then it must be called as fetch_future = tornado.gen.convert_yielded(self.fetch_next_chunk()) to start the background processing. Looping those methods are called, so the values are available during prepare. RequestHandler.data_received(chunk) Implement this method to handle streamed request data. Requires the stream_request_body decorator0 码力 | 333 页 | 322.34 KB | 1 年前3Falcon v3.1.1 Documentation
import io import os import uuid import mimetypes import falcon import msgpack class Resource: _CHUNK_SIZE_BYTES = 4096 # The resource object must now be initialized with a path used during POST while True: chunk = req.stream.read(self._CHUNK_SIZE_BYTES) if not chunk: break image_file.write(chunk) resp.status = falcon resp.status = falcon.HTTP_201 resp.location = '/images/' + name class ImageStore: _CHUNK_SIZE_BYTES = 4096 # Note the use of dependency injection for standard library # methods. We'll0 码力 | 540 页 | 476.60 KB | 1 年前3Falcon v3.1.1-rc1 Documentation
import io import os import uuid import mimetypes import falcon import msgpack class Resource: _CHUNK_SIZE_BYTES = 4096 # The resource object must now be initialized with a path used during POST while True: chunk = req.stream.read(self._CHUNK_SIZE_BYTES) if not chunk: break image_file.write(chunk) resp.status = falcon resp.status = falcon.HTTP_201 resp.location = '/images/' + name class ImageStore: _CHUNK_SIZE_BYTES = 4096 # Note the use of dependency injection for standard library # methods. We'll0 码力 | 540 页 | 476.61 KB | 1 年前3
共 135 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14