Allow specific kinds for sequences

Open
#1,066 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
backend

Research direction

Start by locating SequenceOpts and the sequence enforcement path. Trace how ExcludeKind currently selects kinds, then define IncludedKinds behavior for the listed user:* jobs and verify both the new selection and existing defaults.

Written by the indexing model from the issue text.

Description

enhancement pro

We currently have the following options for sequences:

return riverpro.SequenceOpts{
	ByArgs:              true,
	ContinueOnCancelled: true,
	ContinueOnDiscarded: true,
	ByQueue:             false,
	ExcludeKind:         true,
}

By default, sequences are enforced for each job kind unless we set ExcludeKind: true, so they are enforced across all job kinds. It would be nice to have an IncludedKinds []JobArgs parameter so we can specify a list of kinds we want to include for the sequence instead of having to do everything or just one.

For example, I have the jobs user:add, user:update, user:delete, user:process jobs, but I only want one of these to be running at any given time. Right now, you would need to have a single user:operate to achieve that.

Dominant language
Go
Stars
5.7k
Forks
179
Avg merge
15h 43m
Merged PRs (30d)
13

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from riverqueue/river

All issues in riverqueue/river

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.