Class: ExcADG::VTimeout

Inherits:
Object
  • Object
show all
Defined in:
lib/excadg/vtimeout.rb

Overview

complex vertex timeout to carry fine-grained timeouts

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload: nil, deps: nil, global: nil) ⇒ VTimeout

Returns a new instance of VTimeout.

Parameters:

  • global (defaults to: nil)

    timeout for the whole vertex in seconds

  • deps (defaults to: nil)

    for how long to wait for deps to complete in seconds

  • payload (defaults to: nil)

    how long to wait for payload in seconds



11
12
13
14
15
16
17
18
19
# File 'lib/excadg/vtimeout.rb', line 11

def initialize payload: nil, deps: nil, global: nil
  if !global.nil? && global < (deps || 0) + (payload || 0) && (global < deps + payload)
    raise "global timeout (#{global}) is less than sum of deps (#{deps}) and payload (#{payload}) timeouts"
  end

  @global = global
  @deps = deps
  @payload = payload
end

Instance Attribute Details

#depsObject (readonly)

Returns the value of attribute deps.



6
7
8
# File 'lib/excadg/vtimeout.rb', line 6

def deps
  @deps
end

#globalObject (readonly)

Returns the value of attribute global.



6
7
8
# File 'lib/excadg/vtimeout.rb', line 6

def global
  @global
end

#payloadObject (readonly)

Returns the value of attribute payload.



6
7
8
# File 'lib/excadg/vtimeout.rb', line 6

def payload
  @payload
end