njh / ruby-mqtt

Pure Ruby gem that implements the MQTT protocol, a lightweight protocol for publish/subscribe messaging.
http://www.rubydoc.info/gems/mqtt
MIT License
538 stars 135 forks source link

Remove autoload #153

Closed njh closed 3 weeks ago

njh commented 1 year ago

matz says: "I strongly discourage the use of autoload in any standard libraries" (Re: autoload will be dead) https://bugs.ruby-lang.org/issues/5653

njh commented 1 year ago

Oops, I missed this at the end:

OK, I withdraw the proposal. The autoload method will stay (for Ruby3.0).

Matz.

Do we keep it or remove it 🤔

dentarg commented 3 weeks ago

If it is working, keep it.

Pretty sure autoload is not going away seeing Zeitwerk exists and is very useful. Projects like rack, sinatra, mail and probably many more is using autoload.

With Ruby 3.2.0, this bug https://bugs.ruby-lang.org/issues/18782 Race conditions in autoload when loading the same feature with multiple threads was fixed.

njh commented 3 weeks ago

Ok, great. Thank you!