method

setproctitle

Importance_1
v2_1_10 - Show latest stable - 0 notes - Class: Process
setproctitle(p1) public

Sets the process title that appears on the ps(1) command. Not necessarily effective on all platforms. No exception will be raised regardless of the result, nor will NotImplementedError be raised even if the platform does not support the feature.

Calling this method does not affect the value of $0.

Process.setproctitle('myapp: worker #%d' % worker_id)

This method first appeared in Ruby 2.1 to serve as a global variable free means to change the process title.

Show source
Register or log in to add new notes.