> Am 02.09.2017 um 04:45 schrieb Xingcan Cui <xingc...@gmail.com>:
> 
> In your codes, all the the long values will subtract 1 and be sent back to 
> the iterate operator, endlessly.


Is this true? shouldn't
  val iterationResult2 = env.generateSequence(1, 4).iterate(it => {
    (it.filter(_ > 0).map(_ - 1), it.filter(_ > 0).map(_ => 'y')) // dump 
meaningless 'y' chars just to do anything
  })
  iterationResult2.print()

produce the following _feedback_ streams?

initial input to #iterate(): [1 2 3 4]

iteration #1 : [1 2 3]
iteration #2 : [1 2]
iteration #3 : [1]
iteration #4 : []  => empty feedback stream => cause termination? (which 
actually only happens when setting a timeout value)

Best regards
Peter


Reply via email to