riverqueue/river

Keep queue running during lifetime of application

vsoch opened this issue · 1 comments

This is (I hope) an overly simple question, but I'm adding this to a more complex setup that already has go routines to keep things running. What would be the correct way to do that here? I'd want something that is linked to a context (that will be shared with other routines), e.g.

go wait.UntilWithContext(ctx, startRiver, 0)

<-ctx.Done()
# clean up / close stuff

So my question would be - what should be in StartRiver? Do you have an example? Sorry if it's a very simple question - just looking at this library today (and very excited to use it)!

Oh hmm looking at the bottom of

river/client.go

Line 652 in bf61772

func (c *Client[TTx]) Start(ctx context.Context) error {
. Do I just call Start and give it the context that I have (that I showed above)?