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•8h 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

Show HN: Local-First Linux MicroVMs for macOS

https://shuru.run
51•harshdoesdev•2h ago•13 comments

Show HN: 3D Mahjong, Built in CSS

https://voxjong.com
76•rofko•5h ago•39 comments

Show HN: CIA World Factbook Archive (1990–2025), searchable and exportable

https://cia-factbook-archive.fly.dev/
3•MilkMp•35m ago•0 comments

Show HN: Data Studio – Open-Source Data Notebooks

https://github.com/dataspren-analytics/data-studio
15•alx-net•5d ago•0 comments

Show HN: Llama 3.1 70B on a single RTX 3090 via NVMe-to-GPU bypassing the CPU

https://github.com/xaskasdf/ntransformer
360•xaskasdf•1d ago•93 comments

Show HN: Aeterna – Self-hosted dead man's switch

https://github.com/alpyxn/aeterna
3•alpyxn•1h ago•0 comments

Show HN: TLA+ Workbench skill for coding agents (compat. with Vercel skills CLI)

https://github.com/younes-io/agent-skills/tree/main/skills/tlaplus-workbench
27•youio•7h ago•2 comments

Show HN: Upti – Track cloud provider incidents and get alerts

https://apps.apple.com/us/app/upti-cloud-status-monitor/id6757987553
2•ismailperim•1h ago•0 comments

Show HN: G13u.com An automated SRE for AI apps

https://g13u.com/
3•gerom•1h ago•1 comments

Show HN: Saga – SQLite project tracker for AI coding agents

https://github.com/spranab/saga-mcp
3•spranab•2h ago•0 comments

Show HN: MuJoCo React

https://github.com/noah-wardlow/mujoco-react
3•noahwardlow•2h ago•0 comments

Show HN: Seafruit – Share any webpage to your LLM instantly

https://seafruit.pages.dev
4•svena33•3h ago•2 comments

Show HN: Voted.dev – Vote on New Startups

https://voted.dev
2•dommm•3h ago•0 comments

Show HN: I quit MyNetDiary after 3 years of popups and built a calorie tracker

https://calories.today/app.html
2•davemuz•4h ago•0 comments

Show HN: spdx2dep – Convertig SPDX meta data to debian/copyright (dep5)

https://codeberg.org/buhtz/spdx2dep
2•buhtz•5h ago•0 comments

Show HN: Cryphos – no-code crypto signal bot with Telegram alerts

https://cryphos.com
3•duckducker•7h ago•0 comments

Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust

https://github.com/Ragnaroek/iron-wolf
77•ragnaroekX•1d ago•27 comments

Show HN: Rendering 18,000 videos in real-time with Python

https://madebymohammed.com/pysaic
3•mbmproductions•5h ago•0 comments

Show HN: ZkzkAgent now has safe, local package management

https://github.com/zkzkGamal/zkzkAgent
2•Zakaria_Gamal•5h ago•0 comments

Show HN: Semantic search over Hacker News, built on pgvector

https://ask.rivestack.io/
3•stranger90•5h ago•1 comments

Show HN: Tlsctl – A CLI for inspecting and troubleshooting TLS

https://github.com/catay/tlsctl
3•_smertens_•5h ago•0 comments

Show HN: Drowse – Nix dynamic derivations made easy

https://github.com/figsoda/drowse
4•figsoda•6h ago•0 comments

Show HN: Minimalist Glitch Art Maker (100% client-side)

https://yuyz0112.github.io/glitch-art-maker/
24•yz-yu•5d ago•7 comments

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

https://delvedash.com/
3•GRRRillaDev•6h ago•1 comments

Show HN: ByePhone- An AI assistant to automate tedious phone calls

https://byephone.io/
4•gitpullups•7h ago•1 comments

Show HN: Approve Claude Code permission requests from your phone via ntfy

3•yuu1ch13•7h ago•0 comments

Show HN: A native macOS client for Hacker News, built with SwiftUI

https://github.com/IronsideXXVI/Hacker-News
252•IronsideXXVI•2d ago•186 comments

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

https://github.com/ricwo/pq
2•ricwo•8h ago•0 comments

Show HN: Claude-ts – Translation proxy to fix non-English token waste in Claude

https://github.com/kimi230/claude-ts
3•kiimdonglin•8h ago•0 comments

Show HN: How to Verify USDC Payments on Base Without a Payment Processor

https://paywatcher.dev
2•Sem_pre•8h ago•0 comments