use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use vyuh::{Data, bundles, tasks::TaskOutcome};
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
struct EmailJob {
to: String,
subject: String,
}
#[bundles::task(name = "send_email")]
async fn send_email(input: Data<EmailJob>) -> TaskOutcome {
TaskOutcome::complete(&format!("sent {} to {}", input.subject, input.to)).unwrap()
}
fn app_bundle() -> bundles::Bundle {
bundles::bundle! {
send_email,
}
}
#[tokio::main]
async fn main() {
let _bundle = app_bundle();
}