class Evostream::Events::InStreamClosed

Action inStreamClosed

Attributes

config[R]

Public Class Methods

new(id_flux, config = {}) click to toggle source
Calls superclass method Evostream::Events::Event::new
# File lib/evostream/event/event/events/in_stream_closed.rb, line 7
def initialize(id_flux, config = {})
  super(id_flux)
  @config = config
end

Public Instance Methods

execute() click to toggle source
Calls superclass method Evostream::Events::Event#execute
# File lib/evostream/event/event/events/in_stream_closed.rb, line 12
def execute
  super do |type_flux|
    klass = Evostream::Commands::Destroy.new(remove_config(type_flux))
    Evostream.logger 'Send command to server EvoStream'
    @result = Evostream.send_command(klass.cmd)
    # yield if block_given?
  end
end

Private Instance Methods

remove_config(flux) click to toggle source
# File lib/evostream/event/event/events/in_stream_closed.rb, line 25
def remove_config(flux)
  if @config.empty?
    {
      group_name: "#{Evostream::Service.name}#{flux}",
      remove_hls_hds_files: 1
    }
  else
    @config
  end
end