title: Julia: How to iterate with Channel
body: <p>When I run the following code, I get a deprecation saying produce has been replace with channels.</p>
  
  <pre><code>function source(dir)
      filelist = readdir(dir)
  
      for filename in filelist
          name,ext = splitext(filename)
          if ext == ".jld"
              produce(filename)
          end
      end
  end
  
  path = "somepathdirectoryhere"
  
  for fname in Task(source(path))
      println(fname)
  end
  </code></pre>
  
  <p>I cannot find an example on how to do this with channels.  I've tried creating a global channel and using put! instead of produce with no luck.</p>
  
  <p>Any ideas?</p>