Update ARQ Job Queues documentation and add database session #141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed with @igorbenav, this PR closes #138.
I took the freedom to marginally expand the documentation and rationale of using ARQ Job Queues and added a small h4 section on dealing with a database session.
On a semi-related note, another aspect we could futher explore is dealing with Pydantic objects in these tasks, as ARQ does not deal with them correctly due to serialization. Some approaches require you to cast them back to Pydantic (
your_object = YourObjectPydanticClass(**your_object_dict_from_db)
some just deal with them as dictionaries. Might be useful to point users to a best practice?On a less-related note, @igorbenav I'd love to contribute more and have some ideas to improve the project I'd like to explore. Feel free to drop me a note using my email on my profile.