Sha256: 6ea728bb430624d3da0dd70bffa2fec5732ea49ec267ca96a48cc5e88d91ff5a

Contents?: true

Size: 430 Bytes

Versions: 5

Compression:

Stored size: 430 Bytes

Contents

# frozen_string_literal: true

require_relative "../../lib/tty-spinner"

spinners = TTY::Spinner::Multi.new

sp1 = spinners.register "[:spinner] one"
sp2 = spinners.register "[:spinner] two"
sp3 = spinners.register "[:spinner] three"

th1 = Thread.new { 20.times { sleep(0.2); sp1.spin } }
th2 = Thread.new { 30.times { sleep(0.1); sp2.spin } }
th3 = Thread.new { 10.times { sleep(0.3); sp3.spin } }

[th1, th2, th3].each(&:join)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
planter-cli-3.0.7 lib/tty-spinner/examples/multi/basic.rb
planter-cli-3.0.5 lib/tty-spinner/examples/multi/basic.rb
planter-cli-3.0.4 lib/tty-spinner/examples/multi/basic.rb
planter-cli-3.0.3 lib/tty-spinner/examples/multi/basic.rb
planter-cli-3.0.2 lib/tty-spinner/examples/multi/basic.rb