socketry / async-websocket

Asynchronous WebSocket client and server, supporting HTTP/1 and HTTP/2 for Ruby.
MIT License
173 stars 17 forks source link

Chat example doesn't start #5

Closed bombazook closed 5 years ago

bombazook commented 5 years ago

Rackup chat example with corresponding config.ru (https://github.com/socketry/async-websocket/blob/master/examples/chat/config.ru) using falcon crashes with "No async task available! (RuntimeError)"


/Users/bombazook/.rvm/gems/ruby-2.3.8/gems/async-1.15.1/lib/async/task.rb:143:in `current': No async task available! (RuntimeError)
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/async-io-1.18.4/lib/async/io/socket.rb:162:in `connect'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/async-io-1.18.4/lib/async/io/host_endpoint.rb:51:in `block in connect'
    from /Users/bombazook/.rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/socket.rb:231:in `each'
    from /Users/bombazook/.rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/socket.rb:231:in `foreach'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/async-io-1.18.4/lib/async/io/host_endpoint.rb:49:in `connect'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/async-redis-0.3.2/lib/async/redis/client.rb:110:in `block in connect'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/async-redis-0.3.2/lib/async/redis/pool.rb:112:in `create'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/async-redis-0.3.2/lib/async/redis/pool.rb:125:in `available_resource'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/async-redis-0.3.2/lib/async/redis/pool.rb:101:in `wait_for_resource'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/async-redis-0.3.2/lib/async/redis/pool.rb:47:in `acquire'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/async-redis-0.3.2/lib/async/redis/client.rb:100:in `call'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/async-actor-0.1.0/lib/async/actor/bus/redis.rb:39:in `initialize'
    from /Users/bombazook/dev/async-websocket/examples/chat/config.ru:8:in `new'
    from /Users/bombazook/dev/async-websocket/examples/chat/config.ru:8:in `block in <main>'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
    from /Users/bombazook/dev/async-websocket/examples/chat/config.ru:in `new'
    from /Users/bombazook/dev/async-websocket/examples/chat/config.ru:in `<main>'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/rack-2.0.6/lib/rack/server.rb:219:in `app'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/rack-2.0.6/lib/rack/server.rb:283:in `start'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/rack-2.0.6/lib/rack/server.rb:148:in `start'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/gems/rack-2.0.6/bin/rackup:4:in `<top (required)>'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/bin/rackup:23:in `load'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/bin/rackup:23:in `<main>'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/bin/ruby_executable_hooks:24:in `eval'
    from /Users/bombazook/.rvm/gems/ruby-2.3.8/bin/ruby_executable_hooks:24:in `<main>'`

Am I doing it the wrong way?

ioquatix commented 5 years ago

I am taking a look.

ioquatix commented 5 years ago

That example is an experiment and does't work right now. I will take a look tomorrow and fix it.

ioquatix commented 5 years ago

I've confirmed the chat example is working in the latest release.