Class: Extism::CancelHandle

Inherits:
Object
  • Object
show all
Defined in:
lib/extism/wasm.rb

Overview

A CancelHandle can be used to cancel a running plugin from another thread

Instance Method Summary collapse

Constructor Details

#initialize(handle) ⇒ CancelHandle

Returns a new instance of CancelHandle.



52
53
54
# File 'lib/extism/wasm.rb', line 52

def initialize(handle)
  @handle = handle
end

Instance Method Details

#cancelObject

Cancel the plugin used to generate the handle



57
58
59
# File 'lib/extism/wasm.rb', line 57

def cancel
  LibExtism.extism_plugin_cancel(@handle)
end