19 lines
653 B
Rust
19 lines
653 B
Rust
use crate::util::DatabuildError;
|
|
use crate::{CancelWantRequest, CancelWantResponse, CreateWantRequest, CreateWantResponse};
|
|
use tokio::sync::oneshot;
|
|
|
|
/// Commands that can be sent to the orchestrator via the command channel.
|
|
/// Only write operations need commands; reads go directly to BEL storage.
|
|
pub enum Command {
|
|
/// Create a new want
|
|
CreateWant {
|
|
request: CreateWantRequest,
|
|
reply: oneshot::Sender<Result<CreateWantResponse, DatabuildError>>,
|
|
},
|
|
|
|
/// Cancel an existing want
|
|
CancelWant {
|
|
request: CancelWantRequest,
|
|
reply: oneshot::Sender<Result<CancelWantResponse, DatabuildError>>,
|
|
},
|
|
}
|