urbit/pkg/arvo/lib/default-agent.hoon

70 lines
1.3 KiB
Plaintext
Raw Normal View History

/+ skeleton
|* [agent=* help=*]
?: ?=(%& help)
~| %default-agent-helpfully-crashing
skeleton
2019-11-07 09:19:32 +03:00
|_ =bowl:mall
++ on-init
2019-09-10 23:12:38 +03:00
`agent
::
2019-11-07 09:19:32 +03:00
++ on-save
!>(~)
::
2019-11-07 09:19:32 +03:00
++ on-load
2019-09-10 23:12:38 +03:00
|= old-state=vase
`agent
::
2019-11-07 09:19:32 +03:00
++ on-poke
2019-09-10 23:12:38 +03:00
|= =cage
~| "unexpected poke to {<dap.bowl>} with mark {<p.cage>}"
!!
::
2019-11-07 09:19:32 +03:00
++ on-watch
2019-09-10 23:12:38 +03:00
|= =path
~| "unexpected subscription to {<dap.bowl>} on path {<path>}"
!!
::
2019-11-07 09:19:32 +03:00
++ on-leave
2019-09-10 23:12:38 +03:00
|= path
`agent
::
2019-11-07 09:19:32 +03:00
++ on-peek
2019-09-29 07:44:31 +03:00
|= =path
2019-09-10 23:12:38 +03:00
~| "unexpected scry into {<dap.bowl>} on path {<path>}"
!!
::
2019-11-07 09:19:32 +03:00
++ on-agent
|= [=wire =sign:agent:mall]
2019-11-07 09:19:32 +03:00
^- (quip card:agent:mall _agent)
?- -.sign
%poke-ack
?~ p.sign
`agent
%- (slog leaf+"poke failed from {<dap.bowl>} on wire {<wire>}" u.p.sign)
`agent
::
2019-11-07 09:19:32 +03:00
%watch-ack
?~ p.sign
`agent
=/ =tank leaf+"subscribe failed from {<dap.bowl>} on wire {<wire>}"
%- (slog tank u.p.sign)
`agent
::
2019-11-07 09:19:32 +03:00
%kick `agent
%fact
2019-09-10 23:12:38 +03:00
~| "unexpected subscription update to {<dap.bowl>} on wire {<wire>}"
~| "with mark {<p.cage.sign>}"
2019-09-10 23:12:38 +03:00
!!
==
::
2019-11-07 09:19:32 +03:00
++ on-arvo
|= [=wire =sign-arvo]
~| "unexpected system response {<-.sign-arvo>} to {<dap.bowl>} on wire {<wire>}"
2019-09-10 23:12:38 +03:00
!!
::
2019-11-07 09:19:32 +03:00
++ on-fail
2019-09-10 23:12:38 +03:00
|= [=term =tang]
%- (slog leaf+"error in {<dap.bowl>}" >term< tang)
`agent
--