Convert jobs to messages
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
17
src/rpc.rs
17
src/rpc.rs
@@ -541,6 +541,23 @@ pub fn build_module(state: Arc<AppState>) -> RpcModule<()> {
|
||||
})
|
||||
.expect("register flow.dag");
|
||||
}
|
||||
{
|
||||
let state = state.clone();
|
||||
module
|
||||
.register_async_method("flow.start", move |params, _caller, _ctx| {
|
||||
let state = state.clone();
|
||||
async move {
|
||||
let p: FlowLoadParams = params.parse().map_err(invalid_params_err)?;
|
||||
let started: bool = state
|
||||
.service
|
||||
.flow_start(p.context_id, p.id)
|
||||
.await
|
||||
.map_err(storage_err)?;
|
||||
Ok::<_, ErrorObjectOwned>(started)
|
||||
}
|
||||
})
|
||||
.expect("register flow.start");
|
||||
}
|
||||
|
||||
// Job
|
||||
{
|
||||
|
Reference in New Issue
Block a user