Class: ExecJS::FastNode::ExternalPipedRuntime::VM
- Inherits:
-
Object
- Object
- ExecJS::FastNode::ExternalPipedRuntime::VM
- Defined in:
- lib/execjs/fastnode/external_piped_runtime.rb
Class Method Summary collapse
Instance Method Summary collapse
- #delete_context(context) ⇒ Object
- #exec(context, source) ⇒ Object
-
#initialize(options) ⇒ VM
constructor
A new instance of VM.
- #start ⇒ Object
- #started? ⇒ Boolean
Constructor Details
#initialize(options) ⇒ VM
Returns a new instance of VM.
55 56 57 58 59 |
# File 'lib/execjs/fastnode/external_piped_runtime.rb', line 55 def initialize() @mutex = Mutex.new @socket_path = nil @options = end |
Class Method Details
Instance Method Details
#delete_context(context) ⇒ Object
75 76 77 |
# File 'lib/execjs/fastnode/external_piped_runtime.rb', line 75 def delete_context(context) command("deleteContext", context) end |
#exec(context, source) ⇒ Object
71 72 73 |
# File 'lib/execjs/fastnode/external_piped_runtime.rb', line 71 def exec(context, source) command("exec", {context: context, source: source}) end |
#start ⇒ Object
79 80 81 82 83 |
# File 'lib/execjs/fastnode/external_piped_runtime.rb', line 79 def start @mutex.synchronize do start_without_synchronization end end |
#started? ⇒ Boolean
61 62 63 |
# File 'lib/execjs/fastnode/external_piped_runtime.rb', line 61 def started? !!@socket_path end |