Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

bug in server_sent_events.rb example? #241

Open
woto opened this issue May 9, 2017 · 0 comments
Open

bug in server_sent_events.rb example? #241

woto opened this issue May 9, 2017 · 0 comments

Comments

@woto
Copy link

woto commented May 9, 2017

Hi, it seems some clients will not receive sse because they will be skiped while iterating?
https://github.com/celluloid/reel/blob/master/examples/server_sent_events.rb#L33

@a = [0,1,2,4,3]
@a.each_with_index do |a,i|
  if a%2 == 0
    @a.delete(a) 
  end
end
puts @a.inspect

puts '--'

@a = [0,1,2,4,3]
@a = @a.delete_if {|a|  true if a%2 == 0}
puts @a.inspect
woto@kornev:/docker/box-docker$ ruby test.rb 
[1, 4, 3]
--
[1, 3]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant