Guest User

Untitled

a guest
Jul 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. @data.each_slice(ENVELOPESIZE) do |envelope|
  2. content_hash = { "timestamp" => Time.now.to_i, "listname" => @listname, "html" => html, "chtml" => chtml, "txt" => txt, "ctxt" => ctxt, "sub" => sub, "csub" => csub }
  3. payload = Array[content_hash, envelope]
  4. Nanite.request("/injection/mailer", Marshal.dump(payload), :selector => :least_loaded) do |res|
  5. # p "response: #{res}"
  6. EM.stop_event_loop
  7. end
  8. end
  9. end
  10. end
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17. @data is an array that will be in the millions, envelope size im thinking will be around 10,000 (as a guess, need to tune and figure out what performs best)
Add Comment
Please, Sign In to add comment