blob: 189fccbec6c1b4d8ec2bd207d560501beeb8cae5 [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::streams::update_stream::UpdateStream;
use tracing::debug;
pub async fn handle(
command: &UpdateStream,
sender: &mut dyn Sender,
session: &Session,
system: &SharedSystem,
) -> Result<(), IggyError> {
debug!("session: {session}, command: {command}");
let mut system = system.write();
system
.update_stream(session, &command.stream_id, &command.name)
.await?;
sender.send_empty_ok_response().await?;
Ok(())
}