Class: Flor::TransientExecutor::TransientUnit

Inherits:
Object
  • Object
show all
Defined in:
lib/flor/core/texecutor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conf) ⇒ TransientUnit

Returns a new instance of TransientUnit.



14
15
16
17
18
19
20
21
# File 'lib/flor/core/texecutor.rb', line 14

def initialize(conf)

  @conf = conf
  @opts = {}
  @logger = TransientLogger.new(self)
  @journal = []
  @archive = nil
end

Instance Attribute Details

#archiveObject

Returns the value of attribute archive.



12
13
14
# File 'lib/flor/core/texecutor.rb', line 12

def archive
  @archive
end

#confObject

Returns the value of attribute conf.



9
10
11
# File 'lib/flor/core/texecutor.rb', line 9

def conf
  @conf
end

#journalObject (readonly)

Returns the value of attribute journal.



11
12
13
# File 'lib/flor/core/texecutor.rb', line 11

def journal
  @journal
end

#loaderObject (readonly)

Returns the value of attribute loader.



10
11
12
# File 'lib/flor/core/texecutor.rb', line 10

def loader
  @loader
end

#loggerObject (readonly)

Returns the value of attribute logger.



10
11
12
# File 'lib/flor/core/texecutor.rb', line 10

def logger
  @logger
end

#optsObject

Returns the value of attribute opts.



9
10
11
# File 'lib/flor/core/texecutor.rb', line 9

def opts
  @opts
end

Instance Method Details

#archive_node(exid, node) ⇒ Object



33
34
35
36
# File 'lib/flor/core/texecutor.rb', line 33

def archive_node(exid, node)

  (@archive[exid] ||= {})[node['nid']] = Flor.dup(node) if @archive
end

#has_tasker?(exid, tname) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
41
# File 'lib/flor/core/texecutor.rb', line 38

def has_tasker?(exid, tname)

  false
end

#notify(executor, message) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/flor/core/texecutor.rb', line 23

def notify(executor, message)

  return [] if message['consumed']

  @logger.notify(executor, message)
  @journal << message

  []
end