WsgiHttpIncoming
Extends HttpIncoming.
HTTP request handler that serves WSGI applications.
This class provides a convenient base class for serving WSGI applications on Fastly Compute. Instantiate this, and pass in your application.
12345678910from flask import Flaskfrom fastly_compute.wsgi import WsgiHttpIncoming
app = Flask(__name__)
@app.route("/hello")def hello(): return "Hello, World!"
HttpIncoming = WsgiHttpIncoming(app)Constructor
Construct.
Parameters
- wsgi_app: Callable
The WSGI app to which to delegate requests
- handle_errors: booloptional =
False If True, log any raised exception and return a 500-status response.
- reuse_sandboxes_for_ms: intoptional =
0 If non-0, keep the sandbox alive for this many milliseconds to potentially serve additional requests.
Methods
__call__
View source__call__()Return self to make the instance callable.
This method makes the instance callable, which is required by the WSGI specification. WSGI expects the application to be a callable that returns itself when invoked without arguments.
handle
View sourcehandle(request: http_req.Request, body: async_io.Pollable) -> NoneHandle incoming HTTP requests by serving them through the WSGI app.
Parameters
- request: http_req.Request
- body: async_io.Pollable
Returns