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
- #heartbeat(*details) ⇒ Object
-
#initialize(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(info:, cancellation:, worker_shutdown_cancellation:, payload_converter:, logger:, runtime_metric_meter:) ⇒ RunningActivity
rubocop:disable Lint/MissingSuper
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 301 def initialize( # rubocop:disable Lint/MissingSuper info:, cancellation:, worker_shutdown_cancellation:, payload_converter:, logger:, runtime_metric_meter: ) @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.
299 300 301 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 299 def _outbound_impl @_outbound_impl end |
#_server_requested_cancel ⇒ Object
Returns the value of attribute _server_requested_cancel.
299 300 301 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 299 def _server_requested_cancel @_server_requested_cancel end |
#cancellation ⇒ Object (readonly)
Returns the value of attribute cancellation.
298 299 300 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 298 def cancellation @cancellation end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
298 299 300 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 298 def info @info end |
#instance ⇒ Object
Returns the value of attribute instance.
299 300 301 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 299 def instance @instance end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
298 299 300 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 298 def logger @logger end |
#payload_converter ⇒ Object (readonly)
Returns the value of attribute payload_converter.
298 299 300 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 298 def payload_converter @payload_converter end |
#worker_shutdown_cancellation ⇒ Object (readonly)
Returns the value of attribute worker_shutdown_cancellation.
298 299 300 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 298 def worker_shutdown_cancellation @worker_shutdown_cancellation end |
Instance Method Details
#heartbeat(*details) ⇒ Object
319 320 321 322 323 324 325 326 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 319 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
328 329 330 331 332 333 334 335 336 |
# File 'lib/temporalio/internal/worker/activity_worker.rb', line 328 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 |