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
Rename Args to JobArgs + modify args insert opts check + more tests (#20)
* Rename `Args` to `JobArgs` for better consistency with other River
projects.
* Use a protocol (`JobArgsWithInsertOpts`) for the check on an args for
`insert_opts()` support. (Feels a little more type friendly and also
how other River projects do it.)
* Add tests that verify that insert opts are respected correctly and
various ones that check errors that are returned on invalid insert
conditions.
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -38,10 +38,10 @@ insert_res = client.insert(
38
38
insert_res.job # inserted job row
39
39
```
40
40
41
-
Job args should comply with the following[protocol](https://peps.python.org/pep-0544/):
41
+
Job args should comply with the `riverqueue.JobArgs`[protocol](https://peps.python.org/pep-0544/):
42
42
43
43
```python
44
-
classArgs(Protocol):
44
+
classJobArgs(Protocol):
45
45
kind: str
46
46
47
47
defto_json(self) -> str:
@@ -137,7 +137,7 @@ with engine.begin() as session:
137
137
)
138
138
```
139
139
140
-
## Asynchronous I/O (`asyncio`)
140
+
## Asynchronous I/O (asyncio)
141
141
142
142
The package supports River's [`asyncio` (asynchronous I/O)](https://docs.python.org/3/library/asyncio.html) through an alternate `AsyncClient` and `riversqlalchemy.AsyncDriver`. You'll need to make sure to use SQLAlchemy's alternative async engine and an asynchronous Postgres driver like [`asyncpg`](https://github.com/MagicStack/asyncpg), but otherwise usage looks very similar to use without async:
0 commit comments