Method: Temporalio::Worker#run

Defined in:
lib/temporalio/worker.rb

#run { ... } ⇒ Object

Note:

A worker is only intended to be started once. Initialize a new worker should you need to run it again.

Run the worker and wait on it to be shut down.

This will not return until shutdown is complete (and all running activities finished) and will raise if there is a worker fatal error. To run multiple workers use the class method run.

Yields:

  • Optionally you can provide a block by the end of which the worker will shut itself down. You can use this to stop a worker after some time has passed or any other arbitrary implementation has completed. Any errors raised from this block will be re-raised by this method.



118
119
120
# File 'lib/temporalio/worker.rb', line 118

def run(&block)
  Runner.new(self).run(&block)
end