Logo

0x5a.live

for different kinds of informations and explorations.

GitHub - mborders/artifex: Simple in-memory job queue for Golang using worker-based dispatching

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

Visit SiteGitHub - mborders/artifex: Simple in-memory job queue for Golang using worker-based dispatching

GitHub - mborders/artifex: Simple in-memory job queue for Golang using worker-based dispatching

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

Powered by 0x5a.live ๐Ÿ’—

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/mborders/artifex

Cron jobs use the robfig/cron library: https://godoc.org/github.com/robfig/cron

Example Usage

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

d.Dispatch(func() {
  // do something
})

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

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

// Stop a given DispatchTicker
dt.Stop()

// Returns a DispatchCron
dc, err := d.DispatchCron(func() {
  // do something every 1s
}, "*/1 * * * * *")

// Stop a given DispatchCron
dc.Stop()

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

GoLang Resources

are all listed below.

Resources

listed to get explored on!!

Made with โค๏ธ

to provide different kinds of informations and resources.