Class: Temporalio::Internal::Worker::ActivityWorker::RunningActivity
- Inherits:
-
Activity::Context
- Object
- Activity::Context
- Temporalio::Internal::Worker::ActivityWorker::RunningActivity
- Defined in:
- lib/temporalio/internal/worker/activity_worker.rb
Instance Attribute Summary collapse
-
#_outbound_impl ⇒ Object
Returns the value of attribute _outbound_impl.
-
#_server_requested_cancel ⇒ Object
Returns the value of attribute _server_requested_cancel.
-
#cancellation ⇒ Object
readonly
Returns the value of attribute cancellation.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#instance ⇒ Object
Returns the value of attribute instance.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#payload_converter ⇒ Object
readonly
Returns the value of attribute payload_converter.
-
#worker_shutdown_cancellation ⇒ Object
readonly
Returns the value of attribute worker_shutdown_cancellation.
Instance Method Summary collapse
- #client ⇒ Object
- #heartbeat(*details) ⇒ Object
-
#initialize(worker:, info:, cancellation:, worker_shutdown_cancellation:, payload_converter:, logger:, runtime_metric_meter:) ⇒ RunningActivity
constructor
rubocop:disable Lint/MissingSuper.
- #metric_meter ⇒ Object
Methods inherited from Activity::Context
current, current_or_nil, exist?
Constructor Details
#initialize(worker:, info:, cancellation:, worker_shutdown_cancellation:, payload_converter:, logger:, runtime_metric_meter:) ⇒ RunningActivity
rubocop:disable Lint/MissingSuper
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 304 def initialize( # rubocop:disable Lint/MissingSuper worker:, info:, cancellation:, worker_shutdown_cancellation:, payload_converter:, logger:, runtime_metric_meter: ) @worker = worker @info = info @cancellation = cancellation @worker_shutdown_cancellation = worker_shutdown_cancellation @payload_converter = payload_converter @logger = logger @runtime_metric_meter = runtime_metric_meter @_outbound_impl = nil @_server_requested_cancel = false end |
Instance Attribute Details
#_outbound_impl ⇒ Object
Returns the value of attribute _outbound_impl.
302 303 304 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 302 def _outbound_impl @_outbound_impl end |
#_server_requested_cancel ⇒ Object
Returns the value of attribute _server_requested_cancel.
302 303 304 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 302 def _server_requested_cancel @_server_requested_cancel end |
#cancellation ⇒ Object (readonly)
Returns the value of attribute cancellation.
301 302 303 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 301 def cancellation @cancellation end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
301 302 303 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 301 def info @info end |
#instance ⇒ Object
Returns the value of attribute instance.
302 303 304 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 302 def instance @instance end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
301 302 303 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 301 def logger @logger end |
#payload_converter ⇒ Object (readonly)
Returns the value of attribute payload_converter.
301 302 303 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 301 def payload_converter @payload_converter end |
#worker_shutdown_cancellation ⇒ Object (readonly)
Returns the value of attribute worker_shutdown_cancellation.
301 302 303 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 301 def worker_shutdown_cancellation @worker_shutdown_cancellation end |
Instance Method Details
#client ⇒ Object
343 344 345 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 343 def client @worker.client end |
#heartbeat(*details) ⇒ Object
324 325 326 327 328 329 330 331 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 324 def heartbeat(*details) raise 'Implementation not set yet' if _outbound_impl.nil? # No-op if local return if info.local? _outbound_impl.heartbeat(Temporalio::Worker::Interceptor::Activity::HeartbeatInput.new(details:)) end |
#metric_meter ⇒ Object
333 334 335 336 337 338 339 340 341 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 333 def metric_meter @metric_meter ||= @runtime_metric_meter.with_additional_attributes( { namespace: info.workflow_namespace, task_queue: info.task_queue, activity_type: info.activity_type } ) end |