[PR #157] [CLOSED] make asynqmon importable into other projects #572

Closed
opened 2026-03-07 22:16:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hibiken/asynqmon/pull/157
Author: @ajatprabha
Created: 9/18/2021
Status: Closed

Base: masterHead: master


📝 Commits (10+)

  • 5fbbc0a make server & router reusable outside asynqmon package
  • da0c16e make json data printable
  • 4ee992b add PayloadStringer interface
  • e85cf39 make embed.FS injectable
  • 56e3b1a add injectable PayloadStringer
  • 9481a66 rename go module
  • c8189f3 sort imports
  • 9d9cc73 rename PayloadStringer => BytesStringer
  • 6365dd0 expose http.Handler and hide mux router
  • 10bbd3d revert back to redis/v8

📊 Changes

19 files changed (+716 additions, -534 deletions)

View changed files

📝 .github/workflows/release.yml (+20 -3)
📝 .gitignore (+2 -0)
📝 Dockerfile (+3 -3)
📝 Makefile (+10 -8)
📝 README.md (+50 -0)
cmd/asynqmon/main.go (+137 -0)
📝 cmd/asynqmon/middlewares.go (+0 -0)
cmd/asynqmon/static.go (+58 -0)
📝 conversion_helpers.go (+176 -163)
example_test.go (+30 -0)
📝 go.mod (+3 -3)
📝 go.sum (+34 -34)
handler.go (+134 -0)
main.go (+0 -264)
📝 queue_handlers.go (+7 -6)
📝 redis_info_handlers.go (+10 -10)
📝 scheduler_entry_handlers.go (+8 -7)
📝 server_handlers.go (+6 -6)
📝 task_handlers.go (+28 -27)

📄 Description

I would like to bundle the WebUI server into a single binary that can act as an asnyq server and also serve the asynqmon UI.

For this, we need to import this package into another project, and there are 2 things required to reuse in the derived project:

  • Release the UI as a bundle(a downloadable archive so that rebuild is not required).
  • Export the API router and static server.

This will enable to bundle the static contents in the single binary that is to be generated.

This also adds a BytesStringer interface to convert payload bytes to ui representable string. This comes in handy where how the payload should be converted can be modified by other projects, say the derived project encodes everything via protobuf.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hibiken/asynqmon/pull/157 **Author:** [@ajatprabha](https://github.com/ajatprabha) **Created:** 9/18/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (10+) - [`5fbbc0a`](https://github.com/hibiken/asynqmon/commit/5fbbc0a3e8ac4086e0317c8152ebd80169279773) make server & router reusable outside asynqmon package - [`da0c16e`](https://github.com/hibiken/asynqmon/commit/da0c16e9088afa190988155bea4c636d75d02a8d) make json data printable - [`4ee992b`](https://github.com/hibiken/asynqmon/commit/4ee992b21ac5824cd7715dfb57f7dea8574baa25) add PayloadStringer interface - [`e85cf39`](https://github.com/hibiken/asynqmon/commit/e85cf39de0b7f71d95f4b1d806f36c6e67c0daa5) make embed.FS injectable - [`56e3b1a`](https://github.com/hibiken/asynqmon/commit/56e3b1a6d279742ebdb1344e54a914c384c6cb63) add injectable PayloadStringer - [`9481a66`](https://github.com/hibiken/asynqmon/commit/9481a66b762f4de431142ae34be0ceb3b1675994) rename go module - [`c8189f3`](https://github.com/hibiken/asynqmon/commit/c8189f3bf6d76c4b1fd9f52c29d81b24b2d18fac) sort imports - [`9d9cc73`](https://github.com/hibiken/asynqmon/commit/9d9cc731de3d8ad4e49f225732b41cba4c71b9dd) rename PayloadStringer => BytesStringer - [`6365dd0`](https://github.com/hibiken/asynqmon/commit/6365dd059aa78fb348b846445476cf9e3109cea0) expose http.Handler and hide mux router - [`10bbd3d`](https://github.com/hibiken/asynqmon/commit/10bbd3d0bc54eb3acbd2579f88dd34513bc91f7b) revert back to redis/v8 ### 📊 Changes **19 files changed** (+716 additions, -534 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/release.yml` (+20 -3) 📝 `.gitignore` (+2 -0) 📝 `Dockerfile` (+3 -3) 📝 `Makefile` (+10 -8) 📝 `README.md` (+50 -0) ➕ `cmd/asynqmon/main.go` (+137 -0) 📝 `cmd/asynqmon/middlewares.go` (+0 -0) ➕ `cmd/asynqmon/static.go` (+58 -0) 📝 `conversion_helpers.go` (+176 -163) ➕ `example_test.go` (+30 -0) 📝 `go.mod` (+3 -3) 📝 `go.sum` (+34 -34) ➕ `handler.go` (+134 -0) ➖ `main.go` (+0 -264) 📝 `queue_handlers.go` (+7 -6) 📝 `redis_info_handlers.go` (+10 -10) 📝 `scheduler_entry_handlers.go` (+8 -7) 📝 `server_handlers.go` (+6 -6) 📝 `task_handlers.go` (+28 -27) </details> ### 📄 Description I would like to bundle the WebUI server into a single binary that can act as an `asnyq` server and also serve the `asynqmon` UI. For this, we need to import this package into another project, and there are 2 things required to reuse in the derived project: - Release the UI as a bundle(a downloadable archive so that rebuild is not required). - Export the API router and static server. This will enable to bundle the static contents in the single binary that is to be generated. This also adds a `BytesStringer` interface to convert payload bytes to ui representable string. This comes in handy where how the payload should be converted can be modified by other projects, say the derived project encodes everything via protobuf. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-07 22:16:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynqmon#572
No description provided.