Sha256: 5ab38d713d362c468ec982725a60546af54ab43dc31eb33d36459350e283ade4

Contents?: true

Size: 832 Bytes

Versions: 6

Compression:

Stored size: 832 Bytes

Contents

#+TITLE:        Running scripts in parallel

In the following example, the following 3 scripts should be run in parallel
with all output being flushed to the screen.

- Count some numbers with bash

#+name: bash_counter
#+begin_src sh
echo '' > out.log
for i in `seq 1 5`; do 
echo "Writing! $i"
echo "hello $i" >> out.log
sleep $(($RANDOM % 5))
done
#+end_src

- Count some numbers with ruby

#+name: ruby_counter
#+begin_src ruby
$stdout.sync = true
sleep 0.2
10.times do |n|
  puts "And now writing! #{n}"
  File.open("out.log", "a") {|f| f.puts "Hello again #{n}" }
  sleep rand.round(2)
end
#+end_src

- Print some numbers with python

#+name: python_counter
#+begin_src python :shebang #!/usr/bin/python
for i in range(0,3):
  print i
#+end_src

- Block that should not be run

#+begin_src js
{
  "hello": "world"
}
#+end_src

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
org-converge-0.0.17 spec/converge_examples/basic_run_example/setup.org
org-converge-0.0.16 spec/converge_examples/basic_run_example/setup.org
org-converge-0.0.15 spec/converge_examples/basic_run_example/setup.org
org-converge-0.0.14 spec/converge_examples/basic_run_example/setup.org
org-converge-0.0.13 spec/converge_examples/basic_run_example/setup.org
org-converge-0.0.12 spec/converge_examples/basic_run_example/setup.org