Rails API, app Flutter, infrastruttura Docker/MediaMTX, sito marketing e documentazione di deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
445 B
Ruby
21 lines
445 B
Ruby
module Sessions
|
|
class Pause
|
|
def initialize(session)
|
|
@session = session
|
|
end
|
|
|
|
def call
|
|
@session.pause! if @session.may_pause?
|
|
log_event("paused")
|
|
SessionChannel.broadcast_message(@session, { type: "command", action: "pause_stream" })
|
|
@session
|
|
end
|
|
|
|
private
|
|
|
|
def log_event(type)
|
|
@session.stream_events.create!(event_type: type, occurred_at: Time.current, metadata: {})
|
|
end
|
|
end
|
|
end
|