ames: address review
::
=< =* adult-gate .
=| queued-events=(qeu queued-event)
- =| cached-state=[?(%5 %~) ames-state-5]
+ =| cached-state=(unit [%5 ames-state-5])
::
|= [now=@da eny=@ rof=roof]
=* larval-gate .
~|(%ames-larval-call-dud (mean tang.u.dud))
::
=/ update-ready=?
- ?& ?=([%5 *] cached-state)
+ ?& ?=(^ cached-state)
?=(~ queued-events)
==
?: update-ready
=. ames-state.adult-gate
- (state-5-to-6:load:adult-core +.cached-state)
- =. -.cached-state %~
+ ?> ?=(^ cached-state)
+ (state-5-to-6:load:adult-core +.u.cached-state)
+ =. cached-state ~
~> %slog.1^leaf/"ames: metamorphosis reload"
[~ adult-gate]
:: %born: set .unix-duct and start draining .queued-events
%take (take:adult-core [wire duct ~ sign]:+.first-event)
==
=/ update-ready=?
- ?& ?=([%5 *] cached-state)
+ ?& ?=(^ cached-state)
?=(~ queued-events)
==
?: update-ready
=. ames-state.adult-gate
- (state-5-to-6:load:adult-core +.cached-state)
- =. -.cached-state %~
+ ?> ?=(^ cached-state)
+ (state-5-to-6:load:adult-core +.u.cached-state)
+ =. cached-state ~
~> %slog.1^leaf/"ames: metamorphosis reload"
[moves adult-gate]
:: .queued-events has been cleared; metamorphose
larval-gate
::
[%5 %adult *]
- =. cached-state [%5 state.old]
+ =. cached-state `[%5 state.old]
~> %slog.1^leaf/"ames: larva reload"
larval-gate
::
?. ?=(%known -.ship-state)
ship-state
=/ peer-state=peer-state-5 +.ship-state
- =| =rift
- =/ scry=(unit (unit cage))
+ =/ =rift
+ ;; @ud
+ =< q.q %- need %- need
(rof ~ %j `beam`[[our %rift %da now] /(scot %p ship)])
- =? rift ?=([~ ~ ^] scry)
- ;;(@ud q.q:u.u.scry)
=/ =^peer-state
:_ +.peer-state
=, -.peer-state
