Local SRs.

This commit is contained in:
Julien Fontanet 2014-01-29 18:09:15 +01:00
parent ca64db3e54
commit 19e47a2742
2 changed files with 14 additions and 1 deletions

View File

@ -112,7 +112,10 @@ $watch = (collection, {
# avoid an infinite loop. # avoid an infinite loop.
loops = 0 loops = 0
updating = false
process = (event, items) -> process = (event, items) ->
return if updating
# Values are grouped by namespace. # Values are grouped by namespace.
valuesByNamespace = Object.create null valuesByNamespace = Object.create null
@ -162,10 +165,12 @@ $watch = (collection, {
# changed. # changed.
unless changed is false unless changed is false
values[namespace] = ctx.value values[namespace] = ctx.value
updating = true
if namespace is 'common' if namespace is 'common'
collection.touch consumers collection.touch consumers
else else
collection.touch (namespace.substr 1) collection.touch (namespace.substr 1)
updating = false
loops = previousLoops loops = previousLoops

View File

@ -502,6 +502,14 @@ module.exports = ->
} }
@rule SR: -> @rule SR: ->
@data = {
# Note: not dynamic.
host: $link(
-> @genval.PBDs[0] ? 'OpaqueRef:NULL'
-> @val.host
)
}
@val = { @val = {
name_label: -> @genval.name_label name_label: -> @genval.name_label
@ -521,7 +529,7 @@ module.exports = ->
if @genval.shared if @genval.shared
@genval.$poolRef @genval.$poolRef
else else
null # TODO @data.host
$PBDs: -> @genval.PBDs $PBDs: -> @genval.PBDs