Highlights
These are some big changes but I think they're worth it: everything that does not depend on Postgres, has been moved into its sibling project bgt1 because they solve real problems and I've run into a use case where I needed fault-tolerant background threads, but didn't want to depend on an (unused) Postgres driver.
This is why it's still officially Beta, despite the code being more than mature. Hope someone(s) build something cool on top of bgt!
Full changelog below!
Special Thanks
This release would not be possible without my generous sponsors! Thank you to all of you making sustainable maintenance possible! If you would like to join them, go to https://github.com/sponsors/hynek and check out the sweet perks!
Above and Beyond
Variomedia AG (@variomedia), Tidelift (@tidelift), Kraken Tech (@kraken-tech), Klaviyo (@klaviyo), Privacy Solutions GmbH (@privacy-solutions), FilePreviews (@filepreviews), TestMu AI Open Source Office (Formerly LambdaTest) (@LambdaTest-Inc), Todoist Inc (@Doist), Daniel Fortunov (@asqui), and Kevin P. Fleming (@kpfleming).
Maintenance Sustainers
Buttondown (@buttondown), Christopher Dignam (@chdsbd), Magnus Watn (@magnuswatn), David Cramer (@dcramer), Rivo Laks (@rivol), Polar (@polarsource), Mike Fiedler (@miketheman), Duncan Hill (@cricalix), Colin Marquardt (@cmarqu), Nick Libertini (@libertininick), Brian M. Dennis (@crossjam), Al Sweigart (@asweigart), Celebrity News AG (@celebritynewsag), The Westervelt Company (@westerveltco), Sławomir Ehlert (@slafs), Mostafa Khalil (@khadrawy), Filip Mularczyk (@mukiblejlok), Thomas Klinger (@thmsklngr), Andreas Poehlmann (@ap--), August Trapper Bigelow (@atbigelow), Carlton Gibson (@carltongibson), and Roboflow (@roboflow).
Full Changelog
Removed
- The supervision layer moved to the new bgt package, which pgbg now depends on.
pgbg.Supervisor,pgbg.Service,pgbg.SupervisedService,pgbg.IntervalOnlyWakeup,pgbg.as_work_factory,pgbg.exceptions.SuppressedCrashError, and thepgbg.typing.Loop,pgbg.typing.Wakeup,pgbg.typing.DoWork, andpgbg.typing.WorkFactoryprotocols are gone. Import them frombgtinstead; their behavior is unchanged.
Added
pgbg.sqlalchemy.init_db()that takes a SQLAlchemy Engine or Connection. #1
Changed
-
The
service.notifiedlog event is now calledservice.woken. It fires on any wakeup, not only on notifications. -
The restart counter is now called
bgt_supervisor_restarts_total, because bgt's supervisor drives every loop. The metrics of elected services keep theirpgbg_prefix. Supervision log events now go to thebgtlogger; everything else stays onpgbg.
This release contains contributions from @hynek.
Artifact Attestations
You can verify this release's artifact attestions using GitHub's CLI tool by downloading the sdist and wheel from PyPI and running:
$ gh attestation verify --owner hynek pgbg-26.2.0.tar.gzand
$ gh attestation verify --owner hynek pgbg-26.2.0-py3-none-any.whl-
Vowels are for the weak. 😤 ↩