Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Consider inverting the relationship between the plugin machinery and user functions #107

Open
@dspasojevic

Description

@dspasojevic

Right now, the plugin creates one set of http and sqs functions that will call any function from the user's application.

We should consider kungfu-ing this around so that:

  1. we create a new event type (e.g. durablelambda)
  2. the user annotates the functions that they want to expose with that event type
  3. the plugin processes those events to create new handler functions
  4. the sqs events remain as is

So the user would do something like:

const exampleFunction = {
  handler: `${handlerPath(__dirname)}/example.defaultHandler`,
  events: [
    {
      durableLambda: {
        path: '/things/{id}/clone-the-thing',
        authorizer: {
          name: 'cognitoAuthorizer',
        },
      },
    },
  ]
}

And then the plugin would create an instance of the submit and get handlers, wired to the expected http events.

@NoxHarmonium @haolinj what do you think about this? If it is a good idea, we should do it sooner rather than later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions