Initializes a new asynchronous spinner with no specific end. Must call .stop to end the spinner
.stop
title - Title of the spinner to use
title
CLI::UI::Spinner::Async.new('Title')
: (String title) -> void
29 30 31 32 33 34 35 36
# File 'lib/cli/ui/spinner/async.rb', line 29 def initialize(title) require 'thread' sg = CLI::UI::Spinner::SpinGroup.new @m = Mutex.new @cv = ConditionVariable.new sg.add(title) { @m.synchronize { @cv.wait(@m) } } @t = Thread.new { sg.wait } end