slack-ruby-client icon indicating copy to clipboard operation
slack-ruby-client copied to clipboard

Upgrade to async-websocket >= 0.9

Open dblock opened this issue 6 years ago • 2 comments

The interface has changed, looks like there's a native ws implementation, etc.

cc: @ioquatix I started on this but couldn't make it work

Correct set of includes to start for async.rb

require 'async'
require 'async/websocket'
require 'async/io/ssl_endpoint'
require 'async/notification'
require 'async/clock'

dblock avatar Jul 20 '19 20:07 dblock

Locked down at runtime in https://github.com/slack-ruby/slack-ruby-client/pull/283

dblock avatar Jul 20 '19 20:07 dblock

We have protocol-websocket which is about 4x more memory efficient which was the main driver for the implementation, and it also supports websockets over HTTP/1 and HTTP/2.

You'll need to subclass the Connection class and handle the incoming frames.

The previous implementation depended on faye-websocket event emitter and object types, so you'll need to make some kind of wrapper if you want to have the same interface there.

However, practically speaking, there isn't that much to wrap - it's mostly just text and data frames. Some of the frames emitted by faye don't correspond to actual websocket frames which is probably confusing in hindsight.

ioquatix avatar Jul 20 '19 22:07 ioquatix