Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.35 KB | None | 0 0
  1. func ExecutePipeline(jobs ...job) {
  2.     inputChannel := make(chan interface{})
  3.     for _, job := range jobs {
  4.         outputChannel := make(chan interface{}, 1)
  5.         defer ExecuteJob(job, inputChannel, outputChannel)
  6.         inputChannel = outputChannel
  7.     }
  8. }
  9.  
  10. func ExecuteJob(job job, inputChannel, outputChannel chan interface{}) {
  11.     go job(inputChannel, outputChannel)
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement