event-gateway icon indicating copy to clipboard operation
event-gateway copied to clipboard

Specify async/sync invocation method when invoking directly

Open brianneisler opened this issue 8 years ago • 0 comments

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

  1. Emit and then filter events based on meta property method property allowed values sync - invoke function synchronously and wait for a response async - invoke function async and don't wait for a response

Invoke

fdk.invoke({
  functionId: "createUser",
  data: JSON.stringify({ name: "Max" }),
  method: 'async'
})

brianneisler avatar Aug 03 '17 16:08 brianneisler