--example of using 'httpLiveKeyLoader_AddEventExecutor' see luaScr/user/video/retsports.lua
----------------------------------------------------------------------  	
function httpLiveKeyLoader_nop() 
end
----------------------------------------------------------------------  	
function httpLiveKeyLoader_Log(str,verbose)
 m_simpleTV.Logger.WriteToLog(str,(verbose or 3),'httpLiveKeyLoader')
end
----------------------------------------------------------------------  	 
function httpLiveKeyLoader_IsValid()
 return m_simpleTV.User ~= nil 
        and m_simpleTV.User.HttpLiveKeyLoader ~= nil 
		and m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable ~= nil 
end
----------------------------------------------------------------------  	
function httpLiveKeyLoader_Close(id)
 httpLiveKeyLoader_Log('close id:' ..  id)
 
 if httpLiveKeyLoader_IsValid() then
   for i=1,#m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable do
     _G[m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable[i]]('close', id)
   end     
 end 
 
end
----------------------------------------------------------------------  	
function httpLiveKeyLoader_AddEventExecutor(functionName)
 if type(functionName)~='string' or functionName=='' then 
  httpLiveKeyLoader_Log ('addEventExecutor: bad functionName',1)
  return 
 end
 
 if m_simpleTV.User == nil then m_simpleTV.User = {} end
 if m_simpleTV.User.HttpLiveKeyLoader == nil then m_simpleTV.User.HttpLiveKeyLoader = {} end
 if m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable == nil then m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable = {} end
 
 for i=1,#m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable do
   if m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable[i] == functionName then return end     
 end  
 table.insert(m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable,functionName)
end
----------------------------------------------------------------------  	
function httpLiveKeyLoader_RemoveEventExecutor(functionName)
 if httpLiveKeyLoader_IsValid() then
 
   if type(functionName)~='string' or functionName=='' then 
     httpLiveKeyLoader_Log ('removeEventExecutor: bad functionName',1)
     return 
   end

   for i=1,#m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable do
    if m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable[i] == functionName then 
      table.remove(m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable,i)
      return
    end     
   end 
  end 
end
----------------------------------------------------------------------  	
function httpLiveKeyLoader_Get (id,url)

 if httpLiveKeyLoader_IsValid() then
   for i=1,#m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable do
     local retCode, key = _G[m_simpleTV.User.HttpLiveKeyLoader.EventExecutorTable[i]]('get', id, url)
	 if retCode ~= 0 then return retCode, key end
   end     
 end 

return 0,''
 
end
----------------------------------------------------------------------  	