lib/slack/real_time/concurrency/async.rb in slack-ruby-client-0.14.2 vs lib/slack/real_time/concurrency/async.rb in slack-ruby-client-0.14.3
- old
+ new
@@ -28,11 +28,11 @@
Async do |task|
@restart = ::Async::Notification.new
if client.run_ping?
@ping_task = task.async do |subtask|
- subtask.annotate 'client keep-alive'
+ subtask.annotate "#{client} keep-alive"
# The timer task will naturally exit after the driver is set to nil.
while @restart
subtask.sleep client.websocket_ping
client.run_ping! if @restart
@@ -43,15 +43,16 @@
while @restart
@client_task.stop if @client_task
@client_task = task.async do |subtask|
begin
- subtask.annotate 'client run-loop'
+ subtask.annotate "#{client} run-loop"
client.run_loop
rescue ::Async::Wrapper::Cancelled => e
# Will get restarted by ping worker.
- client.logger.warn(subtask.to_s) { e.message }
+ rescue StandardError => e
+ client.logger.error(subtask.to_s) { e.message }
end
end
@restart.wait
end
@@ -127,5 +128,7 @@
end
end
end
end
end
+
+raise "Incompatible version of async-websocket, #{Async::WebSocket::VERSION}, use \"gem 'async-websocket', '~> 0.8.0'\"." if Gem::Version.new(Async::WebSocket::VERSION) >= Gem::Version.new('0.9.0')