Motty
原生桌面 SSH 工作台:终端、SFTP/SCP、端口转发、VNC 与 RDP 远程桌面、AI 助手都在一个窗口里。Go 编写,没有 Electron,空闲时保持安静。免费开源,支持 macOS、Windows 和 Linux。
翻譯準備中
Database-Backed Durable TypeScript Workflows
翻譯準備中
開發工具TypeScript · JavaScriptGitHub @dbos-inc自行安裝營運者未確認
試用過了嗎? 點一下就好,不需要登入。
11月11日 17:16 檢查 · 分數為各平台在最後檢查時顯示的數值。我們不複製貼文內文與留言,原文刪除後此處也會移除。
製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗DBOS provides lightweight durable workflows built on top of Postgres. Instead of managing your own workflow orchestrator or task queue system, you can use DBOS to add durable workflows and queues to your program in just a few lines of code.
To get started, follow the quickstart to install this open-source library and connect it to a Postgres database. Then, annotate workflows and steps in your program to make it durable! That's all you need to do—DBOS is entirely contained in this open-source library, there's no additional infrastructure for you to configure or manage.
You should consider using DBOS if your application needs to reliably handle failures. For example, you might be building a payments service that must reliably process transactions even if servers crash mid-operation, or a long-running data pipeline that needs to resume seamlessly from checkpoints rather than restart from the beginning when interrupted.
Handling failures is costly and complicated, requiring complex state management and recovery logic as well as heavyweight tools like external orchestration services. DBOS makes it simpler: annotate your code to checkpoint it in Postgres and automatically recover from any failure. DBOS also provides powerful Postgres-backed primitives that make it easier to write and operate reliable code, including durable queues, notifications, scheduling, event processing, and programmatic workflow management.
DBOS workflows make your program durable by checkpointing its state in Postgres. If your program ever fails, when it restarts all your workflows will automatically resume from the last completed step.
You add durable workflows to your existing TypeScript program by registering ordinary functions as workflows and steps:
async function stepOne() {
DBOS.logger.info('Step one completed!');
}
async function stepTwo() {
DBOS.logger.info('Step two completed!');
}
async function workflowFunction() {
await DBOS.runStep(stepOne);
await DBOS.runStep(stepTwo);
}
const workflow = DBOS.registerWorkflow(workflowFunction);
Workflows are particularly useful for
DBOS queues help you durably run tasks in the background. You can enqueue a workflow from a durable workflow and one of your processes will pick it up for execution. DBOS manages the execution of your tasks: it guarantees that tasks complete, and that their callers get their results without needing to resubmit them, even if your application is interrupted.
Queues also provide flow control, so you can limit the concurrency of your tasks on a per-queue or per-process basis. You can also set timeouts for tasks, rate limit how often queued tasks are executed, deduplicate tasks, or prioritize tasks.
You can add queues to your workflows in just a couple lines of code. They don't require a separate queueing service or message broker—just Postgres.
import { DBOS } from '@dbos-inc/dbos-sdk';
const queueName = 'example_queue';
async function taskFunction(task) {
// ...
}
const taskWorkflow = DBOS.registerWorkflow(taskFunction, { name: 'taskWorkflow' });
async function queueFunction(tasks) {
const handles = [];
// Enqueue each task so all tasks are processed concurrently.
for (const task of tasks) {
handles.push(await DBOS.startWorkflow(taskWorkflow, { queueName })(task));
}
// Wait for each task to complete and retrieve its result.
// Return the results of all tasks.
const results = [];
for (const h of handles) {
results.push(await h.getResult());
}
return results;
}
const queueWorkflow = DBOS.registerWorkflow(queueFunction, { name: 'queueWorkflow' });
// Queue configuration is stored in Postgres, so register the queue after launch.
await DBOS.launch();
await DBOS.registerQueue(queueName);
Your workflows are stored as rows in a Postgres table, so you have full programmatic control over them. Write scripts to query workflow executions, batch pause or resume workflows, or even restart failed workflows from a specific step. Handle bugs or failures that affect thousands of workflows with power and flexibility.
以上為 README 的開頭部分。其餘內容請閱讀原文。 檢視完整 README ↗