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

View File

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