frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Pq – Simple, durable background tasks in Python using Postgres

https://github.com/ricwo/pq
1•ricwo•2h ago
At work we were using python-rq for background tasks. It does the job for simple things, but we kept bumping into limitations. We needed to schedule tasks hours / days out and trust they'd survive a restart. We wanted periodic tasks with proper overlap control. So we built a scheduling / enqueuing system around Postgres to bring these durability capabilities to python-rq. This worked fine for a while but was trickier to reason about due to its more complicated architecture (we'd run two separate services just for getting jobs from Postgres into the rq Redis queue, plus N actual task workers).

pq is a simpler approach: It's a Postgres-backed background-task library for Python, using SELECT ... FOR UPDATE SKIP LOCKED for concurrency safety. You just run your N task workers, that's it. The stuff I think is worth knowing about: - Transactional enqueueing -- you can enqueue a task inside the same DB transaction as your writes. If the transaction rolls back, the task never exists. This is the thing Redis literally can't give you. Fork isolation -- every task runs in a forked child process. If it OOMs, segfaults, or leaks memory, the worker just keeps going. The parent monitors via os.wait4() and handles timeouts, OOM kills, and crashes cleanly. - Periodic tasks -- intervals or cron expressions, with overlap control (skip the tick if the previous run is still going), pause/resume without deleting the schedule. Priority queues -- five levels from BATCH to CRITICAL. You can dedicate workers to only process tasks with specific priorities. - Three tables in your main database schema: pq_tasks for one-off tasks, pq_periodic for periodic tasks and pq_alembic_version to track its own schema version (pq manages its own migrations).

There's also client IDs for idempotency and correlation with other tables in your application DB, upsert for debouncing (only the latest version of a task runs), lifecycle hooks that execute in the forked child (useful for fork-unsafe stuff like OpenTelemetry), and async task support.

What it won't do: high throughput (you're polling Postgres). If you need 10k+ tasks/sec or complex DAGs, use something else. For the kind of workload most apps actually have, it's probably sufficient.

pip install python-pq // uv add python-rq repo at https://github.com/ricwo/pq, docs at https://ricwo.github.io/pq

FizzBuzz in Fortran 1

https://mveg.es/posts/fizzbuzz-in-fortran-1/
1•vegesm•3m ago•0 comments

Ask HN: How to get Codex to stop coding so defensively?

1•rishabhpoddar•4m ago•0 comments

The Leading Economic Index for the US Continued to Decline in December

https://www.conference-board.org/topics/us-leading-indicators/index.cfm
1•cjbarber•7m ago•0 comments

Russia-linked cryptocurrency services and sanctions evasion

https://www.elliptic.co/blog/russia-linked-cryptocurrency-services-and-sanctions-evasion
1•janandonly•8m ago•0 comments

I fell for a phishing attack and lost access to my X account

https://christianheilmann.com/2026/02/22/i-fell-for-a-phishing-attack-and-lost-access-to-my-x-acc...
1•MindGods•8m ago•0 comments

How do you know which SKILL.md is good?

https://github.com/razbakov/skills-benchmark
1•razbakov•8m ago•0 comments

What happens at 60% unemployment rate?

https://gruhn.me/blog/2026-02-22/
2•ngruhn•9m ago•0 comments

You still have to think. But only when you want to

https://undecidability.net/thinking/
2•holden_nelson•9m ago•0 comments

Show HN: Delve and Dash – Quick retro dungeon crawler with procedural mazes

https://delvedash.com/
1•GRRRillaDev•10m ago•1 comments

Show HN: Curb – Social Parking Solutions

https://curb-park.com/
1•bekkerza•10m ago•0 comments

Biohackers, wellness influencers are pushing nicotine as part of their 'stacks'

https://www.statnews.com/2026/02/20/nicotine-wellness-startups-productivity-boost-legal-gray-area/
1•zzzeek•10m ago•0 comments

I Use Forth

https://www.bernd-paysan.de/why-forth.html
3•AlexeyBrin•12m ago•1 comments

Cover Your Ass

https://dylancastillo.co/posts/cover-your-ass.html
2•dcastm•18m ago•0 comments

We hid backdoors in ~40MB binaries and asked AI + Ghidra to find them

https://quesma.com/blog/introducing-binaryaudit/
5•jakozaur•19m ago•1 comments

Claude-cobrain:Monitors screen 24/7 to build persistent memory for Claude Code

https://github.com/cyrus-cai/claude-cobrain
1•kii9999•20m ago•0 comments

Yet Another Fix Coming for Older AMD GPUs on Linux – Thanks to Valve Developer

https://www.phoronix.com/news/Hawaii-Macs-AMDGPU-DC-Fix
3•Bender•23m ago•0 comments

Show HN: The only CLI your AI agent will need

https://github.com/brwse/earl
2•jrandolf•23m ago•0 comments

The Pull Request Trap

https://cladam.github.io/2026/02/19/the-pull-request-trap/
2•donutshop•24m ago•0 comments

FORTHought: Self hosted AI stack for physics labs (and more) built on OpenWebUI

https://github.com/MariosAdamidis/FORTHought
2•MariosAdamidis•24m ago•1 comments

Man accidentally gains control of 7k robot vacuums

https://www.popsci.com/technology/robot-vacuum-army/
9•Brajeshwar•25m ago•0 comments

The Internet Archive records its 1Tth website

https://www.popsci.com/technology/internet-archive-1-trillionth-website/
2•Brajeshwar•25m ago•0 comments

Astonishing Spinosaur Unearthed in the Sahara Is Unlike Any Seen Before

https://www.sciencealert.com/astonishing-spinosaur-unearthed-in-the-sahara-is-unlike-any-seen-before
1•Brajeshwar•25m ago•0 comments

Zuckerberg regrets slow progress on spotting under-13s on Instagram

https://www.lemonde.fr/en/pixels/article/2026/02/18/zuckerberg-tells-jury-regrets-slow-progress-o...
3•1vuio0pswjnm7•30m ago•0 comments

Boil the Ocean

https://garryslist.org/posts/boil-the-ocean
3•walterbell•32m ago•0 comments

Boperators: Operator Overloading JavaScript and TypeScript

https://www.npmjs.com/package/boperators
2•thunderbong•32m ago•0 comments

Thoughts on Coding Agents

https://dennybritz.com/posts/coding-agents/
5•dennybritz•35m ago•0 comments

Looking Back on Phabricator for Code Review

https://davidgomes.com/phabricator-code-review/
3•davidgomes•35m ago•0 comments

Have we leapt into commercial genetic testing without understanding it?

https://arstechnica.com/science/2026/02/have-we-leapt-into-commercial-genetic-testing-without-und...
2•Bender•37m ago•0 comments

Study shows how rocket launches pollute the atmosphere

https://insideclimatenews.org/news/19022026/commercial-space-travel-environmental-threat/
3•Bender•38m ago•0 comments

Intensive grazing and soil fertility favor the growth of non-native plants

https://phys.org/news/2026-02-intensive-grazing-soil-fertility-favor.html
4•PaulHoule•40m ago•0 comments