Skip to content

Commit

Permalink
minor documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
bgentry committed Aug 30, 2024
1 parent 19a925d commit 19af887
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions job.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ type Job[T JobArgs] struct {

// JobArgs is an interface that represents the arguments for a job of type T.
// These arguments are serialized into JSON and stored in the database.
//
// The struct is serialized using `encoding/json`. All exported fields are
// serialized, unless skipped with a struct field tag.
type JobArgs interface {
// Kind is a string that uniquely identifies the type of job. This must be
// provided on your job arguments struct.
Expand Down
7 changes: 4 additions & 3 deletions worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
)

// Worker is an interface that can perform a job with args of type T. A typical
// Worker implementation will be a struct that embeds WorkerDefaults, implements
// `Kind()` and `Work()`, and optionally overrides other methods to provide
// job-specific configuration for all jobs of that type:
// implementation will be a JSON-serializable `JobArgs` struct that implements
// `Kind()`, along with a Worker that embeds WorkerDefaults and implements `Work()`.
// Workers may optionally override other methods to provide job-specific
// configuration for all jobs of that type:
//
// type SleepArgs struct {
// Duration time.Duration `json:"duration"`
Expand Down

0 comments on commit 19af887

Please sign in to comment.