@pgflow/edge-worker 0.0.5 → 0.0.7-prealpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/package.json +10 -4
  2. package/.envrc +0 -2
  3. package/CHANGELOG.md +0 -10
  4. package/deno.lock +0 -336
  5. package/deno.test.json +0 -32
  6. package/dist/LICENSE.md +0 -660
  7. package/dist/README.md +0 -46
  8. package/dist/index.js +0 -972
  9. package/dist/index.js.map +0 -7
  10. package/mod.ts +0 -7
  11. package/pkgs/edge-worker/dist/index.js +0 -953
  12. package/pkgs/edge-worker/dist/index.js.map +0 -7
  13. package/pkgs/edge-worker/dist/pkgs/edge-worker/LICENSE.md +0 -660
  14. package/pkgs/edge-worker/dist/pkgs/edge-worker/README.md +0 -46
  15. package/project.json +0 -164
  16. package/scripts/concatenate-migrations.sh +0 -22
  17. package/scripts/wait-for-localhost +0 -17
  18. package/sql/990_active_workers.sql +0 -11
  19. package/sql/991_inactive_workers.sql +0 -12
  20. package/sql/992_spawn_worker.sql +0 -68
  21. package/sql/benchmarks/max_concurrency.sql +0 -32
  22. package/sql/queries/debug_connections.sql +0 -0
  23. package/sql/queries/debug_processing_gaps.sql +0 -115
  24. package/src/EdgeWorker.ts +0 -172
  25. package/src/core/BatchProcessor.ts +0 -38
  26. package/src/core/ExecutionController.ts +0 -51
  27. package/src/core/Heartbeat.ts +0 -23
  28. package/src/core/Logger.ts +0 -42
  29. package/src/core/Queries.ts +0 -44
  30. package/src/core/Worker.ts +0 -102
  31. package/src/core/WorkerLifecycle.ts +0 -93
  32. package/src/core/WorkerState.ts +0 -85
  33. package/src/core/types.ts +0 -47
  34. package/src/flow/FlowWorkerLifecycle.ts +0 -81
  35. package/src/flow/StepTaskExecutor.ts +0 -87
  36. package/src/flow/StepTaskPoller.ts +0 -51
  37. package/src/flow/createFlowWorker.ts +0 -105
  38. package/src/flow/types.ts +0 -1
  39. package/src/index.ts +0 -15
  40. package/src/queue/MessageExecutor.ts +0 -105
  41. package/src/queue/Queue.ts +0 -92
  42. package/src/queue/ReadWithPollPoller.ts +0 -35
  43. package/src/queue/createQueueWorker.ts +0 -145
  44. package/src/queue/types.ts +0 -14
  45. package/src/spawnNewEdgeFunction.ts +0 -33
  46. package/supabase/call +0 -23
  47. package/supabase/cli +0 -3
  48. package/supabase/config.toml +0 -42
  49. package/supabase/functions/cpu_intensive/index.ts +0 -20
  50. package/supabase/functions/creating_queue/index.ts +0 -5
  51. package/supabase/functions/failing_always/index.ts +0 -13
  52. package/supabase/functions/increment_sequence/index.ts +0 -14
  53. package/supabase/functions/max_concurrency/index.ts +0 -17
  54. package/supabase/functions/serial_sleep/index.ts +0 -16
  55. package/supabase/functions/utils.ts +0 -13
  56. package/supabase/seed.sql +0 -2
  57. package/tests/db/compose.yaml +0 -20
  58. package/tests/db.ts +0 -71
  59. package/tests/e2e/README.md +0 -54
  60. package/tests/e2e/_helpers.ts +0 -135
  61. package/tests/e2e/performance.test.ts +0 -60
  62. package/tests/e2e/restarts.test.ts +0 -56
  63. package/tests/helpers.ts +0 -22
  64. package/tests/integration/_helpers.ts +0 -43
  65. package/tests/integration/creating_queue.test.ts +0 -32
  66. package/tests/integration/flow/minimalFlow.test.ts +0 -121
  67. package/tests/integration/maxConcurrent.test.ts +0 -76
  68. package/tests/integration/retries.test.ts +0 -78
  69. package/tests/integration/starting_worker.test.ts +0 -35
  70. package/tests/sql.ts +0 -46
  71. package/tests/unit/WorkerState.test.ts +0 -74
  72. package/tsconfig.lib.json +0 -23
package/dist/README.md DELETED
@@ -1,46 +0,0 @@
1
- <div align="center">
2
- <h1>Edge Worker</h1>
3
- <a href="https://pgflow.dev">
4
- <h3>📚 Documentation @ pgflow.dev</h3>
5
- </a>
6
-
7
- <h4>⚠️ <strong>ADVANCED PROOF of CONCEPT - NOT PRODUCTION READY</strong> ⚠️</h4>
8
- </div>
9
-
10
- A task queue worker for Supabase Edge Functions that extends background tasks with useful features.
11
-
12
- > [!NOTE]
13
- > This project is licensed under [AGPL v3](./LICENSE.md) license and is part of **pgflow** stack.
14
- > See [LICENSING_OVERVIEW.md](../../LICENSING_OVERVIEW.md) in root of this monorepo for more details.
15
-
16
- ## What is Edge Worker?
17
-
18
- Edge Worker processes messages from a queue and executes user-defined functions with their payloads. It builds upon [Supabase Background Tasks](https://supabase.com/docs/guides/functions/background-tasks) to add reliability features like retries, concurrency control and monitoring.
19
-
20
- ## Key Features
21
-
22
- - ⚡ **Reliable Processing**: Retries with configurable delays
23
- - 🔄 **Concurrency Control**: Limit parallel task execution
24
- - 📊 **Observability**: Built-in heartbeats and logging
25
- - 📈 **Horizontal Scaling**: Deploy multiple edge functions for the same queue
26
- - 🛡️ **Edge-Native**: Designed for Edge Functions' CPU/clock limits
27
-
28
- ## How It Works
29
-
30
- [![Architecture Diagram](https://mermaid.ink/img/pako:eNplkcFugzAMhl8lyrl9AQ47VLBxqdSqlZAGHEziASokyEkmTaXvvoR0o1VziGL_n_9Y9pULLZEnvFItwdSxc1op5o9xTUxU_OQmaMAgy2SL7N0pYXutTMUjGU5WlItYaLog1VFAJSv14paCXdweyw8f-2MZLnZ06LBelXxXRk_DztAM-Gp9KA-kpRP-W7bdvs3Ga4aNaAy0OC_WdzD4B4IQVsLMvvkIZMUiA4mu_8ZHYjW5MxNp4dUnKC9zUHJA-h9R_VQTG-sQyDYINlTs-IaPSCP00q_gGvCK2w5HP53EPyXQJczp5jlwVp9-lOCJJYcbTtq13V_gJgkW0x78lEeefMFgfHYC9an1GqPsraZ9XPiy99svlAqmtA?type=png)](https://mermaid.live/edit#pako:eNplkcFugzAMhl8lyrl9AQ47VLBxqdSqlZAGHEziASokyEkmTaXvvoR0o1VziGL_n_9Y9pULLZEnvFItwdSxc1op5o9xTUxU_OQmaMAgy2SL7N0pYXutTMUjGU5WlItYaLog1VFAJSv14paCXdweyw8f-2MZLnZ06LBelXxXRk_DztAM-Gp9KA-kpRP-W7bdvs3Ga4aNaAy0OC_WdzD4B4IQVsLMvvkIZMUiA4mu_8ZHYjW5MxNp4dUnKC9zUHJA-h9R_VQTG-sQyDYINlTs-IaPSCP00q_gGvCK2w5HP53EPyXQJczp5jlwVp9-lOCJJYcbTtq13V_gJgkW0x78lEeefMFgfHYC9an1GqPsraZ9XPiy99svlAqmtA)
31
-
32
- ## Edge Function Optimization
33
-
34
- Edge Worker is specifically designed to handle Edge Function limitations:
35
-
36
- - Stops polling near CPU/clock limits
37
- - Gracefully aborts pending tasks
38
- - Uses PGMQ's visibility timeout to prevent message loss
39
- - Auto-spawns new instances for continuous operation
40
- - Monitors worker health with database heartbeats
41
-
42
-
43
- ## Documentation
44
-
45
- For detailed documentation and getting started guide, visit [pgflow.dev](https://pgflow.dev).
46
-