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

Group functions

Open mthenw opened this issue 8 years ago • 0 comments

Group function is an umbrella term for a function which is not backed by an infrastructure function (like AWS Lambda) but by other functions registered in the EG. It enables building complicated workflows but also canary deployments and A/B tests.

Group function has id, type and a list of backing functions (IDs of functions already registered in the EG). Group function doesn't have provider property.

Group function is just another type of function which means that they can be used for creating async subscriptions or HTTP subscriptions.

Example configuration object:

{
  functionId: "getUser"
  group: {
    type: "weighted"
    functions: [{
      functionId: "getUserV1"
      weight: 9
    }, {
      functionId: "getUserV2"
      weight: 1
    }]
  }
}

Group Function Types

weighted

Described in separate issue: https://github.com/serverless/event-gateway/issues/213

multiregion

Described in separate issue: https://github.com/serverless/event-gateway/issues/216

parallel

Invoke backing functions in parallel and return results from all of them.

waterfall

Invoke backing function in series, each passing their results to the next in the array.

mthenw avatar Aug 17 '17 11:08 mthenw