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

bug in server_sent_events.rb example?  #241

@woto

Description

@woto

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions