Sha256: e2f2bb7e2a1ab5fae57a0dd1cedcc98b939bd6c63fc495c26dc2c46d7d3cf5ca

Contents?: true

Size: 336 Bytes

Versions: 5

Compression:

Stored size: 336 Bytes

Contents

# frozen_string_literal: true

require_relative "../lib/tty-spinner"

spinner = TTY::Spinner.new("[:spinner]")

th1 = Thread.new { 10.times { spinner.spin; sleep(0.1) } }
th2 = Thread.new { 10.times { spinner.spin; sleep(0.1) } }
th3 = Thread.new { 10.times { spinner.spin; sleep(0.1) } }

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

spinner.success

Version data entries

5 entries across 5 versions & 1 rubygems

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