Class: Temporalio::Internal::Bridge::Worker

Inherits:
Object
  • Object
show all
Defined in:
lib/temporalio/internal/bridge/worker.rb

Defined Under Namespace

Classes: Options, TunerOptions, TunerResourceBasedSlotSupplierOptions, TunerSlotSupplierOptions

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.finalize_shutdown_all(workers) ⇒ Object



54
55
56
57
58
59
# File 'lib/temporalio/internal/bridge/worker.rb', line 54

def self.finalize_shutdown_all(workers)
  queue = Queue.new
  async_finalize_all(workers, queue)
  result = queue.pop
  raise result if result.is_a?(Exception)
end

Instance Method Details

#complete_activity_task(proto) ⇒ Object



68
69
70
71
72
73
# File 'lib/temporalio/internal/bridge/worker.rb', line 68

def complete_activity_task(proto)
  queue = Queue.new
  async_complete_activity_task(proto.to_proto, queue)
  result = queue.pop
  raise result if result.is_a?(Exception)
end

#complete_activity_task_in_background(proto) ⇒ Object



75
76
77
78
79
# File 'lib/temporalio/internal/bridge/worker.rb', line 75

def complete_activity_task_in_background(proto)
  queue = Queue.new
  # TODO(cretz): Log error on this somehow?
  async_complete_activity_task(proto.to_proto, queue)
end

#validateObject



61
62
63
64
65
66
# File 'lib/temporalio/internal/bridge/worker.rb', line 61

def validate
  queue = Queue.new
  async_validate(queue)
  result = queue.pop
  raise result if result.is_a?(Exception)
end