How greencoda/tasq works
Tasq is a Go task queue backed by SQL, with PostgreSQL and MySQL implementations. An application submits tasks through a producer; a configured consumer polls for eligible work, dispatches learned handlers, and records outcomes. The client exposes separate inspection and cleanup capabilities, while repository implementations persist queue state. The examples document setup and the broader usage flow; the consumer and repository excerpts show polling, task-state updates, and database access. Other component internals were not sampled, so their links are limited to documented example usage.
Main entry points: repository.go Repository Interface · mysql.go MySQL Repository · postgres.go PostgreSQL Repository · consumer.go Task Consumer
Components 15
Queue API
- Tasq Client
client.go - Task Producer
producer.go - Task Model
task.go
Task Execution
- Task Consumer
consumer.go - Task Handler
SQL Persistence
- Repository Interface
repository.go - MySQL Repository
repository/mysql/mysql.go - MySQL Task Mapping
repository/mysql/mysqlTask.go - MySQL Database
- PostgreSQL Repository
repository/postgres/postgres.go - PostgreSQL Task Mapping
repository/postgres/postgresTask.go - PostgreSQL Database
Queue Operations
- Queue Inspector
inspector.go - Task Cleaner
cleaner.go
Other components
- Application
Connections 17
- Application → Tasq Client: creates
- Application → Task Producer: submits through
- Application → Task Consumer: configures
- Application → Queue Inspector: inspects with
- Application → Task Cleaner: cleans with
- Tasq Client → Repository Interface: wraps
client.go - Task Consumer → Repository Interface: polls and updates
consumer.go - Task Consumer → Task Handler: dispatches
consumer.go - Task Producer → Repository Interface: submits tasks
- Queue Inspector → Repository Interface: queries tasks
- Task Cleaner → Repository Interface: cleans tasks
- MySQL Repository → Repository Interface: implements
- PostgreSQL Repository → Repository Interface: implements
- MySQL Repository → MySQL Task Mapping: converts records
repository/mysql/mysqlTask.go - PostgreSQL Repository → PostgreSQL Task Mapping: converts records
repository/postgres/postgresTask.go - MySQL Repository → MySQL Database: reads and writes
repository/mysql/mysql.go - PostgreSQL Repository → PostgreSQL Database: reads and writes
repository/postgres/postgres.go