multithreading - How to implement multithreaded AbortJob? -


i have implemented following go routines

func main() { go processjob(job) }  func processjob() {     task := range tasks          go performtask(task)        } }  func performtask(task) {     sub := range task {         go perfromsubtask(sub)     } }  func performsubtask(sub) error {          // } 

now want implement abortjob() such if pass jobid abortjob using channels, routines should stop tasks , exits gracefully. how in go?


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -