Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 453 Bytes

README.md

File metadata and controls

26 lines (22 loc) · 453 Bytes

dispatcher

about

dispatcher is a function scheduler that dispatches a limited number of functions and keeps rest of the functions in a list for dispatching later.

use

import pkg

import github.com/sdeoras/dispatcher

dispatch function

d := dispatcher.New(5) // dispatch a max of 5 functions concurrently
d.Do(func(){
	fmt.Println("dispatched")
})

wait for completion

for d.IsRunning() {
	time.Sleep(time.Second)
}