Simply import the base package into your code
import "github.com/pulchre/wingman"
We recommend that each job type be registered in a single package with
wingman.RegisterJobType
in the init function. This package will need to be
imported by both the application and the manager.
To enqueue jobs:
- Import
github.com/pulchre/wingman
- Register job types
- Import the backend package (e.g., github.com/wingman/backend/redis)
- Import the backend support package (e.g., github.com/redis/go-redis)
- Initialize the backend support package
- To enqueue a job, call
backend.PushJob(job)
To build a manager binary:
- Import
github.com/pulchre/wingman
- Register job types
- Import the backend package (e.g., github.com/wingman/backend/redis)
- Import the backend support package (e.g., github.com/redis/go-redis)
- Initialize the backend
redis.Init(redisOpts)
- Initialize a new manager with the desired options,
wingman.NewManager(opts)
- Start the manager,
manager.Start()