Skip to content
forked from DuoSRX/gokiq

Enqueue Sidekiq jobs from Go

License

Notifications You must be signed in to change notification settings

loyalguru/gokiq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gokiq

Gokiq is a small library to easily enqueue Sidekiq jobs from Go.

Usage

import (
  "github.com/duosrx/gokiq"
  "github.com/gomodule/redigo/redis"
  "time"
)

// Create a Redis Pool first
var pool = &redis.Pool{
	MaxIdle:     3,
	IdleTimeout: 240 * time.Second,
	Dial: func() (redis.Conn, error) {
		return redis.Dial("tcp", ":6379")
	},
}

job := NewJob("HardWorker", "default", []string{"foo", "bar"})

// Enqueue immediately...
job.Enqueue(pool)

// ... or enqueue in the future
now := time.Now()
job.EnqueueAt(now, pool)

About

Enqueue Sidekiq jobs from Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%