Sha256: 857bac459a1d8d1b18837085a11d2566140cc516ce9f797ecd27f226bafb9bb6

Contents?: true

Size: 1.19 KB

Versions: 9

Compression:

Stored size: 1.19 KB

Contents

# The poller will run as an infinite loop with long polling to fetch tasks, queue, and run them.
# Topic is the process definition key. Below will run the poller to fetch, lock, and queue a task for the
# example process definition with an id of CamundaWorkflow.
# @example
#   Camunda::Poller.fetch_and_queue %w[CamundaWorkflow]
class Camunda::Poller
  # @deprecated Please use {#fetch_and_queue} instead
  def self.fetch_and_execute(topics, lock_duration: nil, long_polling_duration: nil)
    warn "[DEPRECATION] `fetch_and_execute` is deprecated.  Please use `fetch_and_queue` instead."
    fetch_and_queue(topics, lock_duration: lock_duration, long_polling_duration: long_polling_duration)
  end

  # @param topics [Array] process definition keys
  # @param lock_duration [Integer] lock duration time, default time is set in Camunda::Workflow.configuration
  # @param long_polling_duration [Integer] long polling time, default is set to Camunda::Workflow.configuration
  def self.fetch_and_queue(topics, lock_duration: nil, long_polling_duration: nil)
    loop do
      Camunda::ExternalTask.fetch_and_queue(topics, lock_duration: lock_duration, long_polling_duration: long_polling_duration)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
camunda-workflow-1.0.0 lib/camunda/poller.rb
camunda-workflow-0.6.0 lib/camunda/poller.rb
camunda-workflow-0.5.0 lib/camunda/poller.rb
camunda-workflow-0.4.1 lib/camunda/poller.rb
camunda-workflow-0.4.0 lib/camunda/poller.rb
camunda-workflow-0.3.3 lib/camunda/poller.rb
camunda-workflow-0.3.2 lib/camunda/poller.rb
camunda-workflow-0.3.1 lib/camunda/poller.rb
camunda-workflow-0.3.0 lib/camunda/poller.rb