Skip to content

zipcarz/media

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

media

 function Stream:receive(data)
+  -- Handle data

self:emit("data", data)

  • local lines = split(data, "\n")
  • while #lines > 0 do
  • table.insert(self.lineBuffer, lines[1])
  • table.remove(lines, 1)
  • if #lines > 0 then-- local line = table.concat(self.lineBuffer):gsub("\r$", "")
  •  self.lineBuffer = {}
    
  •  self:emit("line", line)
    
  • -- Handle line buffer if we have any 'line' event handlers set
  • if self.events["line"] then
  • local lines = split(data, "\n")
  • while #lines > 0 do
  •  table.insert(self.lineBuffer, lines[1])
    
  •  table.remove(lines, 1)
    
  •  if #lines > 0 then
    
  •    local line = table.concat(self.lineBuffer):gsub("\r$", "")
    
  •    self.lineBuffer = {}
    
  •    self:emit("line", line+      end
       end
    
                 end
                     end
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published