INNER CODE UNIT · Ruby

initialize

reidmorrison/rocketjob · lib/rocket_job/active_worker.rb:37

    def initialize(name, started_at, job)
      @name       = name
      @started_at = started_at
      @job        = job
    end

    # Duration in human readable form
    def duration
      RocketJob.seconds_as_duration(duration_s)
    end

    # Number of seconds this server has been working on this job / slice
    def duration_s
      Time.now - (started_at || Time.now)
    end

    # Returns [String] the name of the server running this worker
    def server_name

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…