Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ durable = "0.1"
## Quick Start

```rust
use durable::{Durable, Task, TaskContext, TaskResult, WorkerOptions, async_trait};
use durable::{Durable, MIGRATOR, Task, TaskContext, TaskResult, WorkerOptions, async_trait};
use serde::{Deserialize, Serialize};

// Define your task parameters and output
Expand Down Expand Up @@ -101,6 +101,12 @@ async fn main() -> anyhow::Result<()> {
.build()
.await?;

// Run migrations (idempotent - safe to call on every startup)
MIGRATOR.run(client.pool()).await?;

// Create the queue (idempotent - safe to call on every startup)
client.create_queue(None).await?;

// Register your task
client.register::<ResearchTask>().await;

Expand Down