getNextInvocation method

Future<NextInvocation> getNextInvocation ()

Get the next inovation from the AWS Lambda Runtime Interface (see https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html).

Implementation

Future<NextInvocation> getNextInvocation() async {
  final request = await _client.getUrl(Uri.parse(
      'http://${runtimeApi}/${runtimeApiVersion}/runtime/invocation/next'));
  final response = await request.close();
  return NextInvocation.fromResponse(response);
}