Skip to main content

durable_rust/
executor.rs

1use sea_orm::DatabaseConnection;
2
3/// Executor configuration for a durable worker.
4pub struct Executor {
5    db: DatabaseConnection,
6    executor_id: String,
7}
8
9impl Executor {
10    pub fn new(db: DatabaseConnection, executor_id: String) -> Self {
11        Self { db, executor_id }
12    }
13
14    pub fn db(&self) -> &DatabaseConnection {
15        &self.db
16    }
17
18    pub fn executor_id(&self) -> &str {
19        &self.executor_id
20    }
21
22    // TODO: implement recover() after entity codegen
23}