Skip to content

Worker with embeded WorkerDefaults does not implement Worker interface #563

Discussion options

You must be logged in to vote

Something odd is happening in your environment. I copied your code with only minor modifications and it runs fine. It might not be the worst idea to start from scratch, then add custom code back until you find out what's spurring on the error.

$ mkdir river-repro-563
$ cd river-repro-563
$ go mod init github.com/brandur/river-repro-563
$ go get -u github.com/riverqueue/river
$ touch main.go # add code below
package main

import (
	"context"

	"github.com/riverqueue/river"
)

type WorkerArgs struct {
	IDs []int
}

func (a WorkerArgs) Kind() string {
	return "DeleteImagesJob"
}

func (a WorkerArgs) InsertOpts() river.InsertOpts {
	return river.InsertOpts{
		Queue: river.QueueDefault,
	}
}

t…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@taras-turchenko-moc
Comment options

@brandur
Comment options

Answer selected by taras-turchenko-moc
@taras-turchenko-moc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #562 on August 24, 2024 16:17.