1.0.0
A word from the maintainer:
This is the first major release for Procrastinate, and the 50th release of the project. The project has been moving a lot up until 2021, and has slowed down since. In the last year or so, it was almost dormant. One of the reasons was the poor state of sync vs async compatibility code, which made new contributions more complex. It took a few month to gather the motivation for solving this, but the release of the excellent
Psycopg3
, as well as the opportunity to useasgiref
's sync/async compatibility code opened the door for new solutions.This release wouldn't have existed without the help of the users who gave their opinion in #882, and especially @paulzakin and their team who tested beta versions in real-life scenarios.
I'd love for the procrastinate developer team to be bigger, as I'm the only person committing to the project these days (... except for dependency bots, of course). If you use Procrastinate in your life, and would like to give back a little bit of time now and then, please don't hesitate to come say hi (#748).
Happy new year, happy upgrading, and let us know if anything breaks :)
Cheers, Joachim
Migrations
None
Breaking changes
The following is a consequence of the merge of #753 (see also #882)
Aiopg
andPsycopg2
connectors are nowcontrib
. To use them, you'll need to import them withfrom procrastinate.contrib.aiopg import AiopgConnector
andfrom procrastinate.contrib.psycopg2 import Psycopg2Connector
. Also, the dependencies toaiopg
andpsycopg2
are now optional: usepip install procrastinate[aiopg]
orpip install procrastinate[psycopg2]
(orpip install procrastinate[aiopg,psycopg2]
for both)- The main supported connector is now the
PsycopgConnector
that uses Psycopg 3 (andSyncPsycopgConnector
). Please note thatPsycopgConnector
accepts parameters based onpsycopg_pool.ConnectionPool
, which has a slightly different signature from thepsycopg2
/aiopg
counterpart, the main difference is that the connection arguments are now passed asPsycopgConnector(kwargs={"host": "..."})
(instead ofAiopgConnector(host=...)
). Other parameters may have changed too, please check the documentation. - Actually, you probably won't need sync connectors anymore because the Async connectors are now able to derive a sync connector when called in a sync context. You should try defining a single (async) connector in your code such as
PsycopgConnector
(orAiopgConnector
), see if it works with all your existing code and don't hesitate to report potential issues. Synchronous connectors are still available in case you need it, so it should be a workaround in most cases. - Synchronous tasks are now launched asynchronously in a ThreadPoolExecutor using
asgiref.sync_to_async
. That said, because of the Global Interpreter Lock (GIL), CPU-consuming tasks will not run faster with parallelization. - The CLI parser has changed. The main differences should be around the order of arguments vs flag, and around environment variables. If you find something unexpected, please open an issue.
- Opening your app at the same time you instantiate it is now discouraged. Ideally, define your app as a module variable, and open it in the appropriate function (when your process starts). In the future, we may expose new helpers for doing this easily with django. Note that when you use the Procrastinate CLI, it takes care of opening/closing the app properly.
JobManager.check_connection
was an async method. It becamecheck_connection_async
for consistency.check_connection
was created a the sync counterpart.
Dependencies
- Update Deps with major upgrades (major) (#875)
Kudos:
@paulzakin for testing, and the folks who contributed to #882