ruby-mqtt icon indicating copy to clipboard operation
ruby-mqtt copied to clipboard

Remove autoload

Open njh opened this issue 2 years ago • 1 comments

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

  • https://github.com/njh/ruby-mqtt/blob/main/lib/mqtt.rb#L37
  • https://github.com/njh/ruby-mqtt/blob/main/lib/mqtt.rb#L38
  • https://github.com/njh/ruby-mqtt/blob/main/lib/mqtt.rb#L39

njh avatar Feb 17 '23 07:02 njh

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 🤔

njh avatar Feb 17 '23 23:02 njh

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.

dentarg avatar Jun 30 '24 16:06 dentarg

Ok, great. Thank you!

njh avatar Jun 30 '24 17:06 njh