event-gateway
event-gateway copied to clipboard
Specify async/sync invocation method when invoking directly
This is a Feature Request
Description
Sometimes when invoking a function directly, you want to be able to specify the method of invocation (sync or async) at invocation time. For instance, we are trying to do this same thing while integrating with Google Cloud Functions and it's making it a pain to easily integrate.
Use-cases
- Allow for ease of integration by other platforms who want to control the invocation method
- Allow for a function to be invoked in both a sync and async way
Concepts
- Additional 'method' property for the invoke event.
Examples
- Emit and then filter events based on meta property
method property
allowed values
sync- invoke function synchronously and wait for a responseasync- invoke function async and don't wait for a response
Invoke
fdk.invoke({
functionId: "createUser",
data: JSON.stringify({ name: "Max" }),
method: 'async'
})