blob: f1b0685c333f0993b500dd3cdd41cac2448fb82f [file]
use crate::binary::sender::Sender;
use crate::streaming::session::Session;
use crate::streaming::systems::system::SharedSystem;
use anyhow::Result;
use iggy::error::IggyError;
use iggy::topics::delete_topic::DeleteTopic;
use tracing::debug;
pub async fn handle(
command: &DeleteTopic,
sender: &mut dyn Sender,
session: &Session,
system: &SharedSystem,
) -> Result<(), IggyError> {
debug!("session: {session}, command: {command}");
let mut system = system.write();
system
.delete_topic(session, &command.stream_id, &command.topic_id)
.await?;
sender.send_empty_ok_response().await?;
Ok(())
}