Class: Asynq::Client::Candidate

Inherits:
Struct
  • Object
show all
Defined in:
lib/asynq.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#asynqObject

Returns the value of attribute asynq

Returns:

  • (Object)

    the current value of asynq



50
51
52
# File 'lib/asynq.rb', line 50

def asynq
  @asynq
end

#payloadObject

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



50
51
52
# File 'lib/asynq.rb', line 50

def payload
  @payload
end

Instance Method Details

#in(sec) ⇒ Object



51
52
53
# File 'lib/asynq.rb', line 51

def in(sec)
  asynq.in(sec, payload)
end

#jidObject



70
# File 'lib/asynq.rb', line 70

def jid = payload["jid"]

#nowObject



55
56
57
# File 'lib/asynq.rb', line 55

def now
  asynq.now(payload)
end

#with_args(*args, **kwargs) ⇒ Object



64
65
66
67
68
# File 'lib/asynq.rb', line 64

def with_args(*args, **kwargs)
  args.append(kwargs.transform_keys(&:to_s)) unless kwargs.empty?
  payload["args"] = args
  self
end

#with_options(**kw) ⇒ Object



59
60
61
62
# File 'lib/asynq.rb', line 59

def with_options(**kw)
  payload.merge!(kw.transform_keys(&:to_s))
  self
end