Skip to main content

arcly_stream/bus/
events.rs

1//! Stream lifecycle events.
2
3use crate::{AppName, StreamId};
4
5/// A lifecycle event emitted by an [`Application`](super::Application).
6#[derive(Debug, Clone)]
7pub struct StreamEvent {
8    pub app: AppName,
9    pub stream_id: StreamId,
10    pub kind: StreamEventKind,
11}
12
13#[derive(Debug, Clone, PartialEq, Eq)]
14#[non_exhaustive]
15pub enum StreamEventKind {
16    PublishStarted,
17    PublishEnded,
18    SubscriberJoined { protocol: String },
19    SubscriberLeft { protocol: String },
20    RecordingStarted,
21    RecordingEnded,
22    TranscodeStarted,
23    TranscodeEnded,
24    Error { message: String },
25}