goflow icon indicating copy to clipboard operation
goflow copied to clipboard

[GoFlow-4] Allow GoFlow workload to be completely independent to the flow

Open s8sg opened this issue 3 years ago • 1 comments

Currently Flow and Workload are tightly coupled as workload are defined inside of a flow definition This has a few drawbacks

  1. You can't scale only a specific workload
  2. Changing a workload will touch the whole flow definition
  3. Workload can't be shared across other flows

To solve this issue GoFlow will support a special kind of Operation called ApplyExternal() like Apply() It will take a unique ID of the workload that need to be called

Node('n2').ApplyExternal('task1')

To define a workload user need to use the GoFlow Library and Register a Workload using the unique ID

fs.Register('task1', PerformTask1)
fs.StartWorkload(['myflow']) // start workload will take the list of flows

Workload will have the same signature

func PerformTask1(data []byte, option map[string][]string) ([]byte, error) {
  ...
}

s8sg avatar Jul 30 '20 08:07 s8sg

Hi, any updates on this feature?

lyphilip avatar Jan 18 '22 09:01 lyphilip