2020-08-19 22:22:20 +03:00
|
|
|
/- *resource
|
|
|
|
/+ store=graph-store, graph, default-agent, verb, dbug, pull-hook
|
2021-09-30 12:17:49 +03:00
|
|
|
/+ agentio
|
2020-12-05 07:32:17 +03:00
|
|
|
~% %graph-pull-hook-top ..part ~
|
2020-08-19 22:22:20 +03:00
|
|
|
|%
|
|
|
|
+$ card card:agent:gall
|
|
|
|
++ config
|
|
|
|
^- config:pull-hook
|
|
|
|
:* %graph-store
|
|
|
|
update:store
|
|
|
|
%graph-update
|
|
|
|
%graph-push-hook
|
2021-09-28 02:43:36 +03:00
|
|
|
3 3
|
2021-02-02 07:30:48 +03:00
|
|
|
%.n
|
2020-08-19 22:22:20 +03:00
|
|
|
==
|
2021-09-30 11:52:21 +03:00
|
|
|
+$ state-nul ~
|
|
|
|
+$ state-0 [%0 ~]
|
|
|
|
+$ versioned-state
|
|
|
|
$% state-0
|
|
|
|
==
|
2020-08-19 22:22:20 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
%- agent:dbug
|
2021-02-03 22:08:53 +03:00
|
|
|
%+ verb |
|
2020-08-19 22:22:20 +03:00
|
|
|
^- agent:gall
|
|
|
|
%- (agent:pull-hook config)
|
|
|
|
^- (pull-hook:pull-hook config)
|
2021-09-30 11:52:21 +03:00
|
|
|
=| state-0
|
|
|
|
=* state -
|
2020-08-19 22:22:20 +03:00
|
|
|
|_ =bowl:gall
|
|
|
|
+* this .
|
|
|
|
def ~(. (default-agent this %|) bowl)
|
|
|
|
dep ~(. (default:pull-hook this config) bowl)
|
2020-11-03 10:20:46 +03:00
|
|
|
gra ~(. graph bowl)
|
2021-09-30 11:52:21 +03:00
|
|
|
io ~(. agentio bowl)
|
|
|
|
pass pass:io
|
2020-08-19 22:22:20 +03:00
|
|
|
::
|
2020-12-12 23:46:59 +03:00
|
|
|
++ on-init on-init:def
|
2021-09-30 11:52:21 +03:00
|
|
|
++ on-save !>(state)
|
|
|
|
++ on-load
|
|
|
|
|= =vase
|
|
|
|
?: =(q.vase ~)
|
|
|
|
:_ this
|
2021-09-30 12:17:49 +03:00
|
|
|
(poke-self:pass kick+!>(%.y))^~
|
2021-09-30 11:52:21 +03:00
|
|
|
`this
|
|
|
|
::
|
2020-12-12 23:46:59 +03:00
|
|
|
++ on-poke on-poke:def
|
|
|
|
++ on-peek on-peek:def
|
|
|
|
++ on-arvo on-arvo:def
|
|
|
|
++ on-fail on-fail:def
|
|
|
|
++ on-agent on-agent:def
|
|
|
|
++ on-watch on-watch:def
|
|
|
|
++ on-leave on-leave:def
|
2020-08-19 22:22:20 +03:00
|
|
|
++ on-pull-nack
|
|
|
|
|= [=resource =tang]
|
|
|
|
^- (quip card _this)
|
2021-02-03 07:52:48 +03:00
|
|
|
%- (slog leaf+"nacked {<resource>}" tang)
|
2020-08-19 22:22:20 +03:00
|
|
|
:_ this
|
2020-11-03 10:20:46 +03:00
|
|
|
?. (~(has in get-keys:gra) resource) ~
|
2021-09-28 02:43:36 +03:00
|
|
|
=- [%pass /pull-nack %agent [our.bowl %graph-store] %poke %graph-update-3 -]~
|
2020-08-19 22:26:58 +03:00
|
|
|
!> ^- update:store
|
2021-03-18 04:50:14 +03:00
|
|
|
[now.bowl [%archive-graph resource]]
|
2020-08-19 22:22:20 +03:00
|
|
|
::
|
|
|
|
++ on-pull-kick
|
|
|
|
|= =resource
|
|
|
|
^- (unit path)
|
2020-11-03 10:20:46 +03:00
|
|
|
=/ maybe-time (peek-update-log:gra resource)
|
2020-08-19 22:22:20 +03:00
|
|
|
?~ maybe-time `/
|
|
|
|
`/(scot %da u.maybe-time)
|
2021-02-02 07:30:48 +03:00
|
|
|
::
|
|
|
|
++ resource-for-update resource-for-update:gra
|
2020-08-19 22:22:20 +03:00
|
|
|
--
|