title: How to prevent close!-ing before put-ing in onto-chan
body: <p>I'd like to run a code like</p>
  
  <pre><code>(-&gt;&gt; input
       (partition-all 5)
       (map a-side-effect)
       dorun)
  </code></pre>
  
  <p>asynchronously dividing input and output(a-side-effect).</p>
  
  <p>Then I've written the code to experiment below.</p>
  
  <pre><code>;; using boot-clj
  (set-env! :dependencies '[[org.clojure/core.async "0.2.374"]])
  (require '[clojure.core.async :as async :refer [&lt;! &lt;!! &gt;! &gt;!!]])
  
  (let [input (range 18)
        c (async/chan 1 (comp (partition-all 5)
                              (map prn)))]
    (async/onto-chan c input false)
    (async/close! c))
  </code></pre>
  
  <p>explanation for this code:</p>
  
  <ul>
  <li>Actually elements in input and its quantity is not defined before running and elements in input is able to be taken by some numbers from 0 to 10.</li>
  <li><code>async/onto-chan</code> is used to put a Seq of elements (a fragment of input) into the channel <code>c</code> and will be called many times thus the 3rd argument is <code>false</code>.</li>
  <li><code>prn</code> is a substitute for <code>a-side-effect</code>.</li>
  </ul>
  
  <p>I expected the code above prints</p>
  
  <pre><code>[0 1 2 3 4]
  [5 6 7 8 9]
  [10 11 12 13 14]
  [15 16 17]
  </code></pre>
  
  <p>in REPL however it prints no characters.</p>
  
  <p>And then I add a time to wait, like this</p>
  
  <pre><code>(let [c (async/chan 1 (comp (partition-all 5)
                              (map prn)))]
    (async/onto-chan c (range 18) false)
    (Thread/sleep 1000) ;wait
    (async/close! c))
  </code></pre>
  
  <p>This code gave my expected output above.</p>
  
  <p>And then I inspect <code>core.async/onto-chan</code>.</p>
  
  <p>And I think what happend:</p>
  
  <ol>
  <li>the channel <code>c</code> was <code>core.async/close!</code>ed in my code.</li>
  <li>each item of the argument of <code>core.async/onto-chan</code> was put(<code>core.async/&gt;!</code>) in vain in the <code>go-loop</code> in <code>onto-chan</code> because the channel <code>c</code> was closed.</li>
  </ol>
  
  <p>Are there sure ways to put items before <code>close!</code>ing?
  write a synchronous version of <code>onto-chan</code> not using <code>go-loop</code>?</p>
  
  <p>Or is my idea wrong?</p>