Class: NewBridge::AsyncPendingEntry
- Inherits:
-
Object
- Object
- NewBridge::AsyncPendingEntry
- Defined in:
- lib/new_bridge/session_client.rb
Overview
Pending async eval_r_async entry: completion runs on a background thread (not the reader).
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#instance_id ⇒ Object
readonly
Returns the value of attribute instance_id.
-
#timer_thread ⇒ Object
Returns the value of attribute timer_thread.
Instance Method Summary collapse
- #cancel_timer! ⇒ Object
-
#initialize(instance_id, block) ⇒ AsyncPendingEntry
constructor
A new instance of AsyncPendingEntry.
Constructor Details
#initialize(instance_id, block) ⇒ AsyncPendingEntry
Returns a new instance of AsyncPendingEntry.
19 20 21 22 23 |
# File 'lib/new_bridge/session_client.rb', line 19 def initialize(instance_id, block) @instance_id = instance_id @block = block @timer_thread = nil end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
16 17 18 |
# File 'lib/new_bridge/session_client.rb', line 16 def block @block end |
#instance_id ⇒ Object (readonly)
Returns the value of attribute instance_id.
16 17 18 |
# File 'lib/new_bridge/session_client.rb', line 16 def instance_id @instance_id end |
#timer_thread ⇒ Object
Returns the value of attribute timer_thread.
17 18 19 |
# File 'lib/new_bridge/session_client.rb', line 17 def timer_thread @timer_thread end |
Instance Method Details
#cancel_timer! ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/new_bridge/session_client.rb', line 25 def cancel_timer! t = @timer_thread return unless t&.alive? return if Thread.current.equal?(t) t.kill t.join(0.05) rescue StandardError nil end |