Skip to content

Removed singleton dependency#129

Open
hsbt wants to merge 1 commit into
masterfrom
remove-singleton
Open

Removed singleton dependency#129
hsbt wants to merge 1 commit into
masterfrom
remove-singleton

Conversation

@hsbt

@hsbt hsbt commented Jan 31, 2024

Copy link
Copy Markdown
Member

I have a plan to extract singleton library as bundled gems at Ruby 3.5. We should rewrite singleton logic with simple ruby code.

  I have a plan to extract singleton library as bundled gems at Ruby 3.5.
  We should rewrite singleton logic with simple ruby code.

@jeremyevans jeremyevans left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with this. I think it would be better to initialize the instance up front, and store it in a class instance variable. You could even make instance a singleton class attr_reader.

Comment thread lib/webrick/utils.rb
end

def self.instance
@instance ||= new

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this thread safe? (and/or is that a problem here?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants