Skip to content

Add easier support for callbackWaitsForEmptyEventLoop #26

@ShogunPanda

Description

@ShogunPanda

🚀 Feature Proposal

In order to make AWS works properly with mixed callback/async invocation, one might need to modify context.callbackWaitsForEmptyEventLoop.

Nowadays, it is possible with a code like this:

const proxy = awsLambdaFastify(app)

exports.handler = function(event, context, callback) {
  context.callbackWaitsForEmptyEventLoop = false
  return proxy(event, context, callback)
}

But it would be great if it can directly provided as option. See below.

Note that in the implementation checking of the property should be done with options.hasOwnProperty or similar, since both truthy and falsy values are acceptable.

Motivation

To make typical use case easier to manage and without boilerplate code.

Example

exports.handler = awsLambdaFastify(app, {callbackWaitsForEmptyEventLoop: false})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions