Class: Resque::Mcp::Models::Worker

Inherits:
Data
  • Object
show all
Defined in:
lib/resque/mcp/models/worker.rb

Overview

One registered worker. started is an opaque string. current_job is a Models::Job (with queue/run_at) or nil.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_jobObject (readonly)

Returns the value of attribute current_job

Returns:

  • (Object)

    the current value of current_job



8
9
10
# File 'lib/resque/mcp/models/worker.rb', line 8

def current_job
  @current_job
end

#failedObject (readonly)

Returns the value of attribute failed

Returns:

  • (Object)

    the current value of failed



8
9
10
# File 'lib/resque/mcp/models/worker.rb', line 8

def failed
  @failed
end

#heartbeat_expiredObject (readonly)

Returns the value of attribute heartbeat_expired

Returns:

  • (Object)

    the current value of heartbeat_expired



8
9
10
# File 'lib/resque/mcp/models/worker.rb', line 8

def heartbeat_expired
  @heartbeat_expired
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



8
9
10
# File 'lib/resque/mcp/models/worker.rb', line 8

def id
  @id
end

#processedObject (readonly)

Returns the value of attribute processed

Returns:

  • (Object)

    the current value of processed



8
9
10
# File 'lib/resque/mcp/models/worker.rb', line 8

def processed
  @processed
end

#queuesObject (readonly)

Returns the value of attribute queues

Returns:

  • (Object)

    the current value of queues



8
9
10
# File 'lib/resque/mcp/models/worker.rb', line 8

def queues
  @queues
end

#startedObject (readonly)

Returns the value of attribute started

Returns:

  • (Object)

    the current value of started



8
9
10
# File 'lib/resque/mcp/models/worker.rb', line 8

def started
  @started
end

#stateObject (readonly)

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



8
9
10
# File 'lib/resque/mcp/models/worker.rb', line 8

def state
  @state
end

Instance Method Details

#idle?Boolean

Returns:

  • (Boolean)


14
# File 'lib/resque/mcp/models/worker.rb', line 14

def idle? = state == "idle"

#working?Boolean

Returns:

  • (Boolean)


12
# File 'lib/resque/mcp/models/worker.rb', line 12

def working? = state == "working"