MCPcopy
hub / github.com/riverqueue/river / JobArgs

Interface JobArgs

job.go:21–37  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

19// The struct is serialized using `encoding/json`. All exported fields are
20// serialized, unless skipped with a struct field tag.
21type JobArgs interface {
22 // Kind is a string that uniquely identifies the type of job. This must be
23 // provided on your job arguments struct. Jobs are identified by a string
24 // instead of being based on type names so that previously inserted jobs
25 // can be worked across deploys even if job/worker types are renamed.
26 //
27 // Kinds should be formatted without spaces like `my_custom_job`,
28 // `mycustomjob`, or `my-custom-job`. Many special characters like colons,
29 // dots, hyphens, and underscores are allowed, but those like spaces and
30 // commas, which would interfere with UI functionality, are invalid.
31 //
32 // After initially deploying a job, it's generally not safe to rename its
33 // kind (unless the database is completely empty) because River won't know
34 // which worker should work the old kind. Job kinds can be renamed safely
35 // over multiple deploys using the JobArgsWithKindAliases interface.
36 Kind() string
37}
38
39// JobArgsWithKindAliases is an interface that jobs args can implement to
40// provide an alternate kind which a worker will be registered under in addition

Callers

nothing calls this directly

Implementers 15

ReconcileAccountArgsexample_unique_job_test.go
ContextClientArgsexample_client_from_context_test.go
JobWithHooksArgsexample_job_args_hooks_test.go
SnoozingArgsexample_job_snooze_test.go
SubscriptionArgsexample_subscription_test.go
SleepingArgsexample_job_cancel_from_client_test.go
NoOpArgscommon_test.go
SortArgsexample_insert_and_work_test.go
PeriodicJobArgsexample_periodic_job_test.go
CronJobArgsexample_cron_job_test.go
BatchInsertArgsexample_batch_insert_test.go
ResumableCursorArgsexample_resumable_cursor_job_test.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…