class Finalizer
Handles cleanup of proxy resources when the proxy is garbage collected.
Definitions
def initialize(queue, thread)
Initialize a new finalizer.
Signature
-
parameter
queue
Thread::Queue
The message queue to close.
-
parameter
thread
Thread
The worker thread to join.
Implementation
def initialize(queue, thread)
@queue = queue
@thread = thread
end
def call(id)
Clean up proxy resources by closing the queue and joining the thread.
Signature
-
parameter
id
Object
The object id (unused but required by ObjectSpace.define_finalizer).
Implementation
def call(id)
@queue.close
@thread.join
end