octolab / pkg

🧰 Go packages.

Home Page:https://go.octolab.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add async.DelayedJob

kamilsk opened this issue · comments

job := async.NewDelayedJob(make([]func(), 0, 2))

if cond1 {
  job.Do(...)
}

if cond2 {
  job.Do(...)
}

job.Wait()

motivation: if cond1 is false, then no need to create a goroutine