ruby-concurrency / ruby-concurrency/concurrent-ruby

CAtomicFixnum should probably be a private constant

Offen
#981 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Ruby
Sterne
5.8k
Forks
420
Ø Merge
20 Std. 45 Min.
Gemergte PRs (30 T.)
4

Beschreibung

Otherwise we get misleading suggestions from did-you-mean in case concurrent/atomic/atomic_fixnum is not required but the extension is loaded like:

     NameError:
       uninitialized constant Concurrent::AtomicFixnum
     
                 counter = AtomicFixnum.new
                           ^^^^^^^^^^^^
       Did you mean?  Concurrent::CAtomicFixnum
     # ./spec/concurrent/atomic/cyclic_barrier_spec.rb:106:in `block (4 levels) in <module:Concurrent>'

Note that even if it's private, did-you-mean is still kind of misleading:

     NameError:
       uninitialized constant Concurrent::AtomicFixnum
     
                   counter = AtomicFixnum.new
                             ^^^^^^^^^^^^
       Did you mean?  Concurrent::AtomicReference
     # ./spec/concurrent/atomic/cyclic_barrier_spec.rb:191:in `block (5 levels) in <module:Concurrent>'

And there are various specs checking defined? Concurrent::CAtomicFixnum and even a benchmark referencing Concurrent::CAtomicFixnum, so it's not so easy to make it private unfortunately.

Unclear if worth fixing. WIP at https://github.com/ruby-concurrency/concurrent-ruby/compare/master...eregon:concurrent-ruby:private-AtomicFixnum

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Start by reviewing the constant definitions and the specs mentioned in the issue, especially spec/concurrent/atomic/cyclic_barrier_spec.rb, then inspect the WIP comparison branch. Search for specs and benchmark references to Concurrent::CAtomicFixnum. Done means resolving whether the constant can be private without leaving those references inconsistent or retaining the misleading suggestion.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
ruby
Bereich
backend
Issue-Typ
Refactoring
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.