Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,6 @@ if err := riverClient.Start(ctx); err != nil {
}
```

## Insert-only clients

It's often desirable to have a client that'll be used for inserting jobs, but
not working them. This is possible by omitting the `Queues` configuration, and
skipping the call to `Start`:

```go
riverClient, err := river.NewClient(riverpgxv5.New(dbPool), &river.Config{
Workers: workers,
})
if err != nil {
panic(err)
}
```

`Workers` can also be omitted, but it's better to include it so River can check
that inserted job kinds have a worker that can run them.

Expand All @@ -114,6 +99,9 @@ if err := riverClient.Stop(ctx); err != nil {
There are some complexities around ensuring clients stop cleanly, but also in a
timely manner. See [graceful shutdown] for more details on River's stop modes.

[Insert-only clients](/docs/insert-only-clients) will insert jobs, but not work
them, and don't need to be started or stopped.

## Inserting jobs

[`Client.InsertTx`] is used in conjunction with an instance of job args to
Expand Down
Loading