cfn-compose
cfn-compose copied to clipboard
Add support for configurable concurrency mechanism
Summary The number of concurrent go routines spun at the moment is directly related with number of flows being sent in the configuration. Example below configuration spins two go routines as there are two flows in the configuration. The internal logic of the spinning the go routine is, details here:
//Generate the worker pool as pre the flow counts
for i := 0; i < len(cc.Flows); i++ {
go executeFlow(ctx, cfnTask, resultsChan, i)
}
Example
....
Flows:
DemoSQS:
<<: *default
Description: Creates Demo SQS Queue
Stacks:
- template_file: sqs.yml
stack_name: demo-{{ .ENV_NAME }}-sqs-queue
Order: 0
tags:
type: "sqs"
DemoRDSInstance:
<<: *default
Description: Demo RDS Instance
Stacks:
- template_file: rds.yml
stack_name: demo-{{ .ENV_NAME }}-rds-instance
Order: 0
parameters:
EngineVersion: '12.4.0'
Acceptance Criteria: When running cfnc:
- the default behavior should spin the go routine as per the count of the flows but
- we should be able to override the behavior by passing a flag or an environment variable.
- the current concurrency configuration should be some how visible to the end user