Class: Ask::Agent::ToolAbortController
- Inherits:
-
Object
- Object
- Ask::Agent::ToolAbortController
- Defined in:
- lib/ask/agent/tool_abort_controller.rb
Instance Method Summary collapse
- #abort! ⇒ Object
- #aborted? ⇒ Boolean
-
#initialize ⇒ ToolAbortController
constructor
A new instance of ToolAbortController.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ ToolAbortController
Returns a new instance of ToolAbortController.
6 7 8 9 |
# File 'lib/ask/agent/tool_abort_controller.rb', line 6 def initialize @aborted = false @mutex = Mutex.new end |
Instance Method Details
#abort! ⇒ Object
11 12 13 |
# File 'lib/ask/agent/tool_abort_controller.rb', line 11 def abort! @mutex.synchronize { @aborted = true } end |
#aborted? ⇒ Boolean
15 16 17 |
# File 'lib/ask/agent/tool_abort_controller.rb', line 15 def aborted? @mutex.synchronize { @aborted } end |
#reset! ⇒ Object
19 20 21 |
# File 'lib/ask/agent/tool_abort_controller.rb', line 19 def reset! @mutex.synchronize { @aborted = false } end |