Change %wris so it always returns a date.

This removes the scry from +rebuild in ford-turbo. This is ok since ford-turbo
Is the only consumer of %wris. The ford-turbo app now works end-to-end in a
way that theoretically should work without the app.
This commit is contained in:
Elliot Glaysher 2018-05-10 11:18:52 -07:00
parent 52b7351b8f
commit 88ab046d88
4 changed files with 23 additions and 11 deletions

View File

@ -40,7 +40,7 @@
:: clay response to a %multi
::
++ wris
|= {way/wire p/case q/(set (pair care path))}
|= {way/wire p/[%da @da] q/(set (pair care path))}
^- [(list move) _+>.$]
~& [%wris way p q]
::

View File

@ -718,7 +718,9 @@
$: %wris
:: case: case of the new files
::
=case
:: %wris can only return dates to us.
::
case=[%da p=@da]
:: care-paths: the +care:clay and +path of each file
::
care-paths=(set [care=care:clay =path])
@ -1427,17 +1429,14 @@
:: +rebuild: rebuild any live builds based on +resource updates
::
++ rebuild
|= [=beak care-paths=(set [care=care:clay =path])]
|= [ship=@p desk=@tas case=[%da p=@da] care-paths=(set [care=care:clay =path])]
^- [(list move) ford-state]
::
=< finalize
::
=/ date=@da p.case
::
=/ date=@da
?: ?=(%da -.r.beak)
p.r.beak
da:.^(cass:clay %cw /(scot %p p.beak)/[q.beak]/(scot %da now))
=/ =disc [p.beak q.beak]
=/ =disc [ship desk]
:: delete the now-dead clay subscription
::
=. clay-subscriptions.state (~(del in clay-subscriptions.state) disc)
@ -3479,7 +3478,7 @@
=+ [ship desk]=(raid:wired t.t.wire ~[%p %tas])
::
=* rebuild rebuild:(per-event event-args)
(rebuild [ship desk case.sign] care-paths.sign)
(rebuild ship desk case.sign care-paths.sign)
:: %resource: response to a request for a +resource
::
?. =(%scry-request i.t.wire)

View File

@ -598,7 +598,20 @@
|= {hen/duct das/(set mood)}
^+ +>
?> ?=(^ das)
=- (emit hen %give %wris q.n.das -)
:: translate the case to a date
::
=/ cas=[%da p=@da]
:: if the case is already a date, use it.
::
?: ?=([%da *] q.n.das)
q.n.das
:: translate other cases to dates
::
=/ aey (case-to-aeon:ze q.n.das)
?~ aey [%da `@da`0]
?: =(0 u.aey) [%da `@da`0]
[%da t:(aeon-to-yaki:ze u.aey)]
=- (emit hen %give %wris cas -)
(~(run in `(set mood)`das) |=(m/mood [p.m r.m]))
::
:: Give next step in a subscription.

View File

@ -394,7 +394,7 @@
{$rule red/dict wit/dict} :: node r+w permissions
{$send p/lane:ames q/@} :: transmit packet
{$writ p/riot} :: response
{$wris p/case p/(set (pair care path))} :: many changes
{$wris p/{$da p/@da} q/(set (pair care path))} :: many changes
== ::
++ task :: in request ->$
$% {$boat $~} :: pier rebooted