Class: Wurk::Flow::Status::Node
- Inherits:
-
Object
- Object
- Wurk::Flow::Status::Node
- Defined in:
- lib/wurk/flow/status.rb
Overview
One node of the graph, as stored. Reads only — Builder's Node is the declaration-side object and holds the caller's arguments; this one holds what Redis has, which is the part that changes as the flow runs.
Constant Summary collapse
- STATES =
%w[waiting enqueued succeeded dead broken].freeze
Instance Attribute Summary collapse
-
#bid ⇒ Object
readonly
Returns the value of attribute bid.
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#dependents ⇒ Object
readonly
Returns the value of attribute dependents.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#jid ⇒ Object
readonly
Returns the value of attribute jid.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#remaining ⇒ Object
readonly
Returns the value of attribute remaining.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(fields) ⇒ Node
constructor
A new instance of Node.
-
#piped? ⇒ Boolean
True when this node is handed its dependency's stored result.
Constructor Details
#initialize(fields) ⇒ Node
Returns a new instance of Node.
117 118 119 120 121 |
# File 'lib/wurk/flow/status.rb', line 117 def initialize(fields) read_identity(fields) read_edges(fields) read_progress(fields) end |
Instance Attribute Details
#bid ⇒ Object (readonly)
Returns the value of attribute bid.
114 115 116 |
# File 'lib/wurk/flow/status.rb', line 114 def bid @bid end |
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
114 115 116 |
# File 'lib/wurk/flow/status.rb', line 114 def dependencies @dependencies end |
#dependents ⇒ Object (readonly)
Returns the value of attribute dependents.
114 115 116 |
# File 'lib/wurk/flow/status.rb', line 114 def dependents @dependents end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
114 115 116 |
# File 'lib/wurk/flow/status.rb', line 114 def error @error end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
114 115 116 |
# File 'lib/wurk/flow/status.rb', line 114 def index @index end |
#jid ⇒ Object (readonly)
Returns the value of attribute jid.
114 115 116 |
# File 'lib/wurk/flow/status.rb', line 114 def jid @jid end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
114 115 116 |
# File 'lib/wurk/flow/status.rb', line 114 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
114 115 116 |
# File 'lib/wurk/flow/status.rb', line 114 def name @name end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
114 115 116 |
# File 'lib/wurk/flow/status.rb', line 114 def queue @queue end |
#remaining ⇒ Object (readonly)
Returns the value of attribute remaining.
114 115 116 |
# File 'lib/wurk/flow/status.rb', line 114 def remaining @remaining end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
114 115 116 |
# File 'lib/wurk/flow/status.rb', line 114 def state @state end |
Instance Method Details
#data ⇒ Object
128 129 130 131 132 133 134 135 |
# File 'lib/wurk/flow/status.rb', line 128 def data { 'index' => @index, 'name' => @name, 'class' => @klass, 'queue' => @queue, 'jid' => @jid, 'bid' => @bid, 'state' => @state, 'depends_on' => @dependencies, 'dependents' => @dependents, 'remaining' => @remaining, 'piped' => @piped, 'error' => @error } end |
#piped? ⇒ Boolean
Returns true when this node is handed its dependency's stored result. The sentinel itself is not published: it is an internal splice marker, and its bytes say nothing a reader wants.
126 |
# File 'lib/wurk/flow/status.rb', line 126 def piped? = @piped |