10000 GitHub - mborders/artifex at v0.2
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mborders/artifex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc Build Status Go Report Card codecov

artifex

Simple in-memory job queue for Golang using worker-based dispatching

Documentation here: https://godoc.org/github.com/alphaterra/artifex

Example Usage

// 10 workers, 100 max in job queue
d := artifex.NewDispatcher(10, 100)
d.Run()

d.Dispatch(artifex.Job{Run: func() {
  // do something
}})

err := d.DispatchIn(artifex.Job{Run: func() {
  // do something in 500ms
}}, time.Millisecond*500)

// Returns a DispatchTicker
dt, err := d.DispatchEvery(artifex.Job{Run: func() {
  // do something every 250ms
}}, time.Millisecond*250)

// Stop a given DispatchTicker
dt.Stop()

// Stop a dispatcher and all its workers
d.Stop()

About

Simple in-memory job queue for Golang using worker-based dispatching

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages

0