socketry/lightio

Compatible with Ruby 2.5 or higher?

98-f355-f1 opened this issue · 8 comments

Is this Ruby 2.5 friendly... I am getting initialization errors from the kernel for require.
I also noticed that I cant install the other gems, b/c hitimes is not compatible with Ruby 2.5.

hitimes should certainly be compatible with Ruby 2.5.

@ioquatix @98-f355-f1 I have also just double checked and added ruby 2.5 to my travis ci config for hitimes. Yes - hitimes does work just fine on 2.5.

jjyr commented

Can you paste your script and error log?

I was out of town for 2 days, update on issues:
It seems that I am no longer getting the hitimes errors, so that is closed. Thanks to hitimes.
I am playing around with all of the socketry gems, but only so far have the async gem going. The rest just flag all kinds of initialization errors;
I have install all the gems from the socketry repository, including the nio gem, if needed.

For this LIGHTIO gem, trying to run some of the examples:
Traceback (most recent call last):
17: from ./lightioexample.rb:1:in <main>' 16: from C:/Ruby25/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:39:in require'
15: from C:/Ruby25/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:133:in rescue in require' 14: from C:/Ruby25/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:133:in require'
13: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio.rb:5:in <top (required)>' 12: from C:/Ruby25/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require'
11: from C:/Ruby25/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' 10: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core.rb:2:in <top (required)>'
9: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core.rb:2:in require_relative' 8: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core/ioloop.rb:4:in <top (required)>'
7: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core/ioloop.rb:67:in <module:Core>' 6: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core/ioloop.rb:59:in current'
5: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core/ioloop.rb:59:in new' 4: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core/ioloop.rb:12:in initialize'
3: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core/ioloop.rb:12:in new' 2: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core/backend/nio.rb:64:in initialize'
1: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core/backend/nio.rb:64:in new' C:/Ruby25/lib/ruby/gems/2.5.0/gems/nio4r-2.3.1/lib/nio/selector.rb:17:in initialize': unsupported backend: (ArgumentError)

For the async-http, when I run the async-http example.
Traceback (most recent call last):
11: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/async-1.10.0/lib/async/task.rb:74:in block in initialize' 10: from ./async-http.rb:20:in block (2 levels) in

'
9: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/async-http-0.24.3/lib/async/http/server.rb:69:in run' 8: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/async-io-1.12.2/lib/async/io/endpoint.rb:46:in accept'
7: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/async-http-0.24.3/lib/async/http/url_endpoint.rb:118:in bind' 6: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/async-io-1.12.2/lib/async/io/host_endpoint.rb:55:in bind'
5: from C:/Ruby25/lib/ruby/2.5.0/socket.rb:227:in foreach' 4: from C:/Ruby25/lib/ruby/2.5.0/socket.rb:227:in each'
3: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/async-io-1.12.2/lib/async/io/host_endpoint.rb:56:in block in bind' 2: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/async-io-1.12.2/lib/async/io/socket.rb:166:in bind'
1: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/async-io-1.12.2/lib/async/io/socket.rb:110:in build' C:/Ruby25/lib/ruby/gems/2.5.0/gems/async-io-1.12.2/lib/async/io/socket.rb:168:in block in bind': uninitialized constant Socket::SO_REUSEPORT (NameError)
Did you mean? Socket::SO_REUSEADDR

For the falcon, it's not clear how to run that? falcon serve... from where? the cmd prompt? otherwise it flags the run command.
Traceback (most recent call last):
./falconexample.rb:14:in <main>': undefined method run' for main:Object (NoMethodError)

For the socketry itself, so far 2 examples have run... so good so far there.

Thanks for looking into this.

@98-f355-f1 LightIO is a bit of an experiment, I'm not sure if the long term plan is to complete it or maintain it.

Regarding falcon, just run it in a directory with a config.ru file and it will serve it. Check falcon --help for more details. Otherwise, feel free to open an issue on that repo, I am happy to help you and improve the documentation where it makes sense.

Also, my understanding is that the actual socketry gem is no longer being actively maintained, although I believe it's fairly feature complete.

Regarding Socket::SO_REUSEPORT (NameError), can you please open an issue on the async-io repository. Thanks :) It looks like an issue with Windows.

jjyr commented

Seems LightIO crashed because it can't detect a usable NIO backend(this line), I thought use nil argument should let NIO automatic find a usable backend(or maybe it's another windows issue?).

I do not have windows installed, you can try to specific which backend to use manually https://github.com/socketry/lightio/wiki/Basic-Usage#choose-backend