Class: Async::Signals::Controller::Registration

Inherits:
Object
  • Object
show all
Defined in:
lib/async/signals/controller.rb

Overview

Represents an installed set of signal handlers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller, handlers) ⇒ Registration

Initialize the registration.



91
92
93
94
95
# File 'lib/async/signals/controller.rb', line 91

def initialize(controller, handlers)
	@controller = controller
	@handlers = handlers
	@context = Context.current
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



98
99
100
# File 'lib/async/signals/controller.rb', line 98

def context
  @context
end

Instance Method Details

#closeObject

Remove this registration from the controller.



101
102
103
104
105
106
# File 'lib/async/signals/controller.rb', line 101

def close
	if handlers = @handlers
		@handlers = nil
		@controller.remove(self, handlers)
	end
end

#The context that installed this registration.=(contextthatinstalledthisregistration. = (value)) ⇒ Object



98
# File 'lib/async/signals/controller.rb', line 98

attr :context