-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Experimental Feature Proposal
This issue proposes an experimental feature for inline activity creation and execution.
Proposed API Usage
let future = activity_executor
.activity()
.max_retry(3)
.idempotency("123")
.run(json!({}), async |ctx: ActivityContext, payload: serde_json::Value| -> ActivityHandlerResult {
let fx_quote = client
.get_fx_quote(FxQuoteRequest {
source_currency: payload.source_currency.string(),
target_currency: payload.target_currency.string(),
amount: payload.amount,
})
.await
.map_err(|e| ActivityError::Retry(e.to_string()))?;
let fx_quote_reference = fx_quote.reference.clone();
let fx_quote = client
.execute_fx(ExecuteFxRequest {
quote_reference: fx_quote.reference.clone(),
})
.await
.map_err(|e| ActivityError::Retry(e.to_string()))?;
Ok(json!({
"amount": fx_quote.target.amount,
"reference": fx_quote_reference,
}))
})
.await;
match future.get_result().await.unwrap(); {
Ok() => {}
_ => {}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels