Skip to content

MultiTask is simple task manager. you can use it to process multiple tasks and receive result from these tasks.

License

Notifications You must be signed in to change notification settings

LinkSyk/multitask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MultiTask

MultiTask is simple task manager. you can use it to process multiple tasks and receive result from these tasks.

Quick start

create two task to count number.

mt := NewMultiTask()

mt.Do(func(ch chan<- interface{}) {
    for i := 0; i < 100; i++ {
        ch <- 1
    }
})
mt.Do(func(ch chan<- interface{}) {
    for i := 0; i < 100; i++ {
        ch <- 1
    }
})

cnt := 0
mt.Fetch(func(result interface{}) {
    cnt += 1
})

mt.Wait()

create two task, not to recv.

mt := NewMultiTask()

mt.Do(func(ch chan<- interface{}) {
    for i := 0; i < 100; i++ {
        // do something
    }
})
mt.Do(func(ch chan<- interface{}) {
    for i := 0; i < 100; i++ {
        // do something
    }
})

mt.Wait()

About

MultiTask is simple task manager. you can use it to process multiple tasks and receive result from these tasks.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages