You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update README with a few tweaks and some new content from docs (#8)
Updates the README with some additions and changes that fell out of
writing the documentation page for River in Ruby. Specifically there are
new sections for inserting in a transaction and RBS + type checking.
Copy file name to clipboardExpand all lines: docs/README.md
+42-18Lines changed: 42 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ An insert-only Ruby client for [River](https://github.com/riverqueue/river) pack
4
4
5
5
## Basic usage
6
6
7
-
`Gemfile` should contain the core gem and a driver like [`rubyqueue-sequel`](https://github.com/riverqueue/riverqueue-ruby/drivers/riverqueue-sequel) (see [drivers](#drivers)):
7
+
Your project's `Gemfile` should contain the `riverqueue` gem and a driver like [`riverqueue-sequel`](https://github.com/riverqueue/riverqueue-ruby/drivers/riverqueue-sequel) (see [drivers](#drivers)):
8
8
9
-
```ruby
9
+
```ruby
10
10
gem "riverqueue"
11
11
gem "riverqueue-sequel"
12
12
```
@@ -44,7 +44,7 @@ Job args should:
44
44
45
45
They may also respond to `#insert_opts` with an instance of `InsertOpts` to define insertion options that'll be used for all jobs of the kind.
46
46
47
-
###Insertion options
47
+
## Insertion options
48
48
49
49
Inserts take an `insert_opts` parameter to customize features of the inserted job:
50
50
@@ -60,17 +60,7 @@ insert_res = client.insert(
60
60
)
61
61
```
62
62
63
-
### Inserting with a Ruby hash
64
-
65
-
`JobArgsHash` can be used to insert with a kind and JSON hash so that it's not necessary to define a class:
No extra code is needed to insert jobs from inside a transaction. Just make sure that one is open from your ORM of choice, call the normal `#insert` or `#insert_many` methods, and insertions will take part in it.
The gem [bundles RBS files](https://github.com/riverqueue/riverqueue-ruby/tree/master/sig) containing type annotations for its API to support type checking in Ruby through a tool like [Sorbet](https://sorbet.org/) or [Steep](https://github.com/soutaro/steep).
112
+
93
113
## Drivers
94
114
95
115
### ActiveRecord
96
116
97
-
```ruby
117
+
Use River with [ActiveRecord](https://guides.rubyonrails.org/active_record_basics.html) by putting the `riverqueue-activerecord` driver in your `Gemfile`:
0 commit comments