Skip to content

Commit 6386aac

Browse files
committed
Tidy up instance name handling.
1 parent 3977136 commit 6386aac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/async/container/forked.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ def to_json(...)
5555
# Set the process title to the specified value.
5656
# @parameter value [String] The name of the process.
5757
def name= value
58-
if @name = value
59-
::Process.setproctitle(@name)
60-
end
58+
@name = value
59+
60+
# This sets the process title to an empty string if the name is nil:
61+
::Process.setproctitle(@name.to_s)
6162
end
6263

6364
# The name of the process.

lib/async/container/threaded.rb

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def self.for(thread)
5353
end
5454

5555
def initialize(io)
56-
@name = nil
5756
@thread = ::Thread.current
5857

5958
super

0 commit comments

Comments
 (0)