push-hook: rekick watches that had been kicked on migrate
pull-hook-name=term
==
::
-:: $state-0: state for the push hook
+:: $base-state-0: state for the push hook
::
:: .sharing: resources that the push hook is proxying
:: .inner-state: state given to internal door
::
-+$ state-0
- $: %0
- sharing=(set resource)
++$ base-state-0
+ $: sharing=(set resource)
inner-state=vase
==
::
++$ state-0 [%0 base-state-0]
+::
++$ state-1 [%1 base-state-0]
+::
++$ versioned-state
+ $% state-0
+ state-1
+ ==
++ push-hook
|* =config
$_ ^|
++ agent
|* =config
|= =(push-hook config)
- =| state-0
+ =| state-1
=* state -
^- agent:gall
=<
++ on-load
|= =old=vase
=/ old
- !<(state-0 old-vase)
- =^ cards push-hook
+ !<(versioned-state old-vase)
+ =| cards=(list card:agent:gall)
+ |^
+ ?- -.old
+ %1
+ =^ og-cards push-hook
(on-load:og inner-state.old)
- `this(state old)
+ [(weld cards og-cards) this(state old)]
+ ::
+ %0
+ %_ $
+ -.old %1
+ ::
+ cards
+ =/ paths=(list path)
+ kicked-watches
+ ?~ paths cards
+ :_ cards
+ [%give %kick paths ~]
+ ==
+ ==
+ ::
+ ++ kicked-watches
+ ^- (list path)
+ %~ tap in
+ %+ roll
+ ~(val by sup.bowl)
+ |= [[=ship =path] out=(set path)]
+ ?~ path out
+ ?. (lth 4 (lent path))
+ out
+ (~(put in out) path)
+ --
::
++ on-save
=. inner-state
