Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.05 KB

INSTALL.md

File metadata and controls

33 lines (25 loc) · 1.05 KB

Wingman Installation

Simply import the base package into your code

import "github.com/pulchre/wingman"

Suggested structure

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.

Application

To enqueue jobs:

  1. Import github.com/pulchre/wingman
  2. Register job types
  3. Import the backend package (e.g., github.com/wingman/backend/redis)
  4. Import the backend support package (e.g., github.com/redis/go-redis)
  5. Initialize the backend support package
  6. To enqueue a job, call backend.PushJob(job)

Manager

To build a manager binary:

  1. Import github.com/pulchre/wingman
  2. Register job types
  3. Import the backend package (e.g., github.com/wingman/backend/redis)
  4. Import the backend support package (e.g., github.com/redis/go-redis)
  5. Initialize the backend redis.Init(redisOpts)
  6. Initialize a new manager with the desired options, wingman.NewManager(opts)
  7. Start the manager, manager.Start()