Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion awslambdaric/lambda_runtime_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import http
import http.client
import sys
from concurrent.futures import ThreadPoolExecutor
from awslambdaric import __version__


Expand Down Expand Up @@ -65,7 +66,9 @@ def post_init_error(self, error_response_data):
raise LambdaRuntimeClientError(endpoint, response.code, response_body)

def wait_next_invocation(self):
response_body, headers = runtime_client.next()
with ThreadPoolExecutor() as e:
fut = e.submit(runtime_client.next)
response_body, headers = fut.result()
return InvocationRequest(
invoke_id=headers.get("Lambda-Runtime-Aws-Request-Id"),
x_amzn_trace_id=headers.get("Lambda-Runtime-Trace-Id"),
Expand Down