igorbenav / FastAPI-boilerplate

An extendable async API using FastAPI, Pydantic V2, SQLAlchemy 2.0, PostgreSQL and Redis.
MIT License
589 stars 69 forks source link

Update ARQ Job Queues documentation and add database session #141

Closed leonardovida closed 4 months ago

leonardovida commented 4 months ago

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.

igorbenav commented 4 months ago

Nice one, @leonardovida! Thanks I'll send you an email