Skip to content

Commit 0787a63

Browse files
authored
Improved quickstart (#23)
* added create queue to quickstart * added migrations to readme
1 parent 7f8f4f6 commit 0787a63

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ durable = "0.1"
4141
## Quick Start
4242

4343
```rust
44-
use durable::{Durable, Task, TaskContext, TaskResult, WorkerOptions, async_trait};
44+
use durable::{Durable, MIGRATOR, Task, TaskContext, TaskResult, WorkerOptions, async_trait};
4545
use serde::{Deserialize, Serialize};
4646

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

104+
// Run migrations (idempotent - safe to call on every startup)
105+
MIGRATOR.run(client.pool()).await?;
106+
107+
// Create the queue (idempotent - safe to call on every startup)
108+
client.create_queue(None).await?;
109+
104110
// Register your task
105111
client.register::<ResearchTask>().await;
106112

0 commit comments

Comments
 (0)