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
Description
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:
- we create a new event type (e.g.
durablelambda
) - the user annotates the functions that they want to expose with that event type
- the plugin processes those events to create new handler functions
- 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.