diff --git a/examples/game-of-life.py b/examples/game-of-life.py index 83d7c10..e2944d1 100644 --- a/examples/game-of-life.py +++ b/examples/game-of-life.py @@ -263,4 +263,4 @@ def root(): if running_under_compute: - HttpIncoming = WsgiHttpIncoming(app, reuse_sessions_for_ms=300) + HttpIncoming = WsgiHttpIncoming(app, reuse_sandboxes_for_ms=300) diff --git a/fastly_compute/wsgi.py b/fastly_compute/wsgi.py index 1273bfa..5cf6bbc 100644 --- a/fastly_compute/wsgi.py +++ b/fastly_compute/wsgi.py @@ -139,19 +139,19 @@ def __init__( self, wsgi_app: Callable, handle_errors: bool = False, - reuse_sessions_for_ms: int = 0, + reuse_sandboxes_for_ms: int = 0, ): """Construct. :arg wsgi_app: The WSGI app to which to delegate requests :arg handle_errors: If True, log any raised exception and return a 500-status response. - :arg reuse_sessions_for_ms: If non-0, keep the service instance alive - for this many milliseconds to potentially serve additional requests. + :arg reuse_sandboxes_for_ms: If non-0, keep the sandbox alive for this + many milliseconds to potentially serve additional requests. """ self.wsgi_app = wsgi_app self.handle_errors = handle_errors - self.reuse_sessions_for_ms = reuse_sessions_for_ms + self.reuse_sandboxes_for_ms = reuse_sandboxes_for_ms def __call__(self): return self @@ -165,7 +165,7 @@ def handle(self, request: Any, body: Any) -> None: handle_errors=self.handle_errors, ) - if not self.reuse_sessions_for_ms: + if not self.reuse_sandboxes_for_ms: return try: @@ -191,7 +191,7 @@ def handle(self, request: Any, body: Any) -> None: "Our use of send() to consume the previous request unexpectedly actually performed a send." ) - options = NextRequestOptions(timeout_ms=self.reuse_sessions_for_ms, extra=None) + options = NextRequestOptions(timeout_ms=self.reuse_sandboxes_for_ms, extra=None) while True: pending_request = next_request(options) try: