mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 09:51:36 +03:00
68 lines
1.3 KiB
Plaintext
68 lines
1.3 KiB
Plaintext
/- *resource
|
|
/+ store=graph-store, graph, default-agent, verb, dbug, pull-hook
|
|
/+ agentio
|
|
~% %graph-pull-hook-top ..part ~
|
|
|%
|
|
+$ card card:agent:gall
|
|
++ config
|
|
^- config:pull-hook
|
|
:* %graph-store
|
|
update:store
|
|
%graph-update
|
|
%graph-push-hook
|
|
3 3
|
|
%.n
|
|
==
|
|
+$ state-nul ~
|
|
+$ state-0 [%0 ~]
|
|
+$ versioned-state
|
|
$% state-0
|
|
==
|
|
--
|
|
::
|
|
%- agent:dbug
|
|
%+ verb |
|
|
^- agent:gall
|
|
%- (agent:pull-hook config)
|
|
^- (pull-hook:pull-hook config)
|
|
=| state-0
|
|
=* state -
|
|
|_ =bowl:gall
|
|
+* this .
|
|
def ~(. (default-agent this %|) bowl)
|
|
dep ~(. (default:pull-hook this config) bowl)
|
|
gra ~(. graph bowl)
|
|
io ~(. agentio bowl)
|
|
pass pass:io
|
|
::
|
|
++ on-init on-init:def
|
|
++ on-save !>(state)
|
|
++ on-load
|
|
|= =vase
|
|
?: =(q.vase ~)
|
|
:_ this
|
|
(poke-self:pass kick+!>(%.y))^~
|
|
`this
|
|
::
|
|
++ 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
|
|
++ on-pull-nack
|
|
|= [=resource =tang]
|
|
^- (quip card _this)
|
|
`this
|
|
::
|
|
++ on-pull-kick
|
|
|= =resource
|
|
^- (unit path)
|
|
=/ maybe-time (peek-update-log:gra resource)
|
|
?~ maybe-time `/
|
|
`/(scot %da u.maybe-time)
|
|
::
|
|
++ resource-for-update resource-for-update:gra
|
|
--
|