handler = async (event, context) => {
  const {
    functionName,
    functionVersion,
    memoryLimitInMB,
    logGroupName,
    logStreamName,
    clientContext,
    identity,
    invokedFunctionArn,
    awsRequestId,
    callbackWaitsForEmptyEventLoop,
  } = context // Extract the context properties that are not functions

  await publishMessage(topics.request, {
    event, // Send the event to the local machine
    environment: envVarsToSend, // Send the environment variables to the local machine
    context: {
      // Send the context properties to the local machine
      awsRequestId,
      functionName,
      functionVersion,
      memoryLimitInMB,
      logGroupName,
      logStreamName,
      clientContext,
      identity,
      invokedFunctionArn,
      callbackWaitsForEmptyEventLoop,
    },
  })

  // Wait for the response from the local machine, or a timeout message if no response is received
  const response = await Promise.race([
    waitForResponse(awsRequestId),
    waitForNoResponse(),
  ])

  // return the response to the Lambda caller
  return response
}
Invokes a Lambda function, publishes its context and event to a specified topic, and waits for a response.
This function first deconstructs the `context` object provided by AWS Lambda to extract non-function context properties to send to the local machine.
The function then calls `publishMessage` to this function's invocation topic.
After publishing the message, the function waits for a response using `waitForResponse`.
The response from `waitForResponse` is then returned to the caller.

@param {Object} event - The event data that triggered the Lambda function. This could be from an S3 event, DynamoDB, custom events, etc.
@param {Object} context - The AWS Lambda execution context, providing metadata and settings related to the function's invocation.
@returns {Promise<Object>} The response from `waitForResponse`, expected to be the result of the external operation initiated by publishing the message.