Add generalized e2e protocol.

This commit is contained in:
C. Guy Yarvin 2015-06-22 14:02:27 -07:00
parent ffe56f6205
commit 0ee06a785c
5 changed files with 27 additions and 69 deletions

View File

@ -11,15 +11,12 @@
== == ::
$: %a :: to %ames
$% [%kick p=@da] ::
== == ::
$: %g :: to %gall
$% [%rote p=sack q=path r=*] ::
[%roth p=sack q=path r=*] ::
== == ::
$: @tas :: to any
$% [%init p=@p] ::
[%want p=sock q=path r=*] ::
[%wart p=sock q=@tas r=path s=*] ::
[%west p=sack q=path r=*] ::
== == == ::
++ sign :: in result $<-
$? $: %a :: from %ames
@ -1672,7 +1669,7 @@
:+ (scot %p p.p.bon)
(scot %p q.p.bon)
q.q.bon
[hen %pass pax %g %rote p.bon /hood 0 %m %will wil]~
[hen %pass pax %g %west p.bon /ge/hood 0 %m %will wil]~
?> ?=([@ @ *] t.q.q.bon)
:_ fox
=+ [cak=i.t.q.q.bon ven=i.t.t.q.q.bon]
@ -1723,51 +1720,14 @@
:_ fox
:~ [hen [%slip %c %wart p.bon i.t.q.q.bon t.t.q.q.bon r.bon]]
==
::
%ye :: %ye
:: ~& [%ye bon]
?> =(p.p.bon (sein q.p.bon))
=+ ^= paz ^- (list ,@p)
%+ skim pals:(~(um am [now fox]) p.p.bon)
|=(a=@p =(p.p.bon (sein a)))
:_ fox
%+ turn paz
|= him=ship
:- hen
[%pass /ye %g %rote `sack`p.bon /ye 0 %m %helm-ye ((hard ,@t) r.bon)]
==
::
%mulk
:: ~& [%mulk p.bon q.bon]
?> ?=([@ @ *] q.q.bon)
?> ?=(%q i.q.q.bon)
?+ i.t.q.q.bon
~& %mulk-bad
:_ fox
:~ :- (claw p.p.bon)
[%sick %wart p.bon i.t.q.q.bon t.t.q.q.bon r.bon]
==
::
%ge :: %gall request
=* imp t.t.q.q.bon
?> (levy imp (sane %ta))
=+ ^= pax
:+ (scot %p p.p.bon)
(scot %p q.p.bon)
q.q.bon
:: ~& [%ames-gall-request p.bon imp pax]
:_ fox [hen %pass pax %g %rote p.bon imp r.bon]~
::
%gh :: %gall response
=* imp t.t.q.q.bon
?> (levy imp (sane %ta))
=+ ^= pax
:+ (scot %p p.p.bon)
(scot %p q.p.bon)
q.q.bon
:: ~& [%ames-gall-response p.bon imp pax]
:_ fox [hen %pass pax %g %roth p.bon imp r.bon]~
==
?> ?=(?(%a %c %e %g) i.q.q.bon)
=+ pax=[(scot %p p.p.bon) (scot %p q.p.bon) q.q.bon]
:_ fox [hen %pass pax i.q.q.bon %west p.bon t.q.q.bon r.bon]~
::
%ouzo
:: ~& [%send now p.bon `@p`(mug (shaf %flap q.bon))]
@ -1862,6 +1822,9 @@
::
%wont
(~(wise am [now fox]) p.kyz hen q.kyz r.kyz &)
::
%west
!!
==
=> %_(. fox q.fuy)
=| out=(list move)

View File

@ -2481,6 +2481,8 @@
blobs/`lat.ran.ruf
==
==
::
%west !!
==
::
++ doze

View File

@ -641,7 +641,8 @@
(ames-gram q.p.kyz hat/~ p.u.mez our-host)
==
::
%wegh !!
%wegh !! :: handled elsewhere
%west !!
==
::
++ axom :: old response

View File

@ -227,7 +227,7 @@
==
%+ mo-pass
[%sys %way -.q.caz ~]
`note-arvo`[%a %wont [our him] [%q %ge p.caz ~] [num roc]]
`note-arvo`[%a %wont [our him] [%g %ge p.caz ~] [num roc]]
::
++ mo-baal :: error convert a
|= art=(unit ares)
@ -344,7 +344,7 @@
(mo-pass [%sys pax] %g %deal [him our] dap %pump ~)
~& [%diff-bad-ack q.+>.sih] :: should not happen
=. +>.$ (mo-pass [%sys pax] %g %deal [him our] dap %pull ~)
(mo-pass [%sys pax] %a %wont [our him] [%q %gh dap ~] [num %x ~])
(mo-pass [%sys pax] %a %wont [our him] [%g %gh dap ~] [num %x ~])
::
%rep :: reverse request
?> ?=([@ @ @ ~] t.pax)
@ -378,10 +378,10 @@
?- -.cuf
%coup (mo-give %mack p.cuf)
%diff %+ mo-pass [%sys %red t.pax]
[%a %wont [our him] [%q %gh dap ~] [num %d p.p.cuf q.q.p.cuf]]
[%a %wont [our him] [%g %gh dap ~] [num %d p.p.cuf q.q.p.cuf]]
%doff !!
%quit %+ mo-pass [%sys pax]
[%a %wont [our him] [%q %gh dap ~] [num %x ~]]
[%a %wont [our him] [%g %gh dap ~] [num %x ~]]
%reap (mo-give %mack p.cuf)
==
::
@ -1140,28 +1140,18 @@
:: ~& [%gall-init p.q.hic]
[~ ..^$(pol.all (~(put by pol.all) p.q.hic [hen ~ ~ ~]))]
::
%rote
:: ~& [%gall-rote p.q.hic]
%west
?. (~(has by pol.all) p.p.q.hic)
~& [%gall-not-ours p.q.hic]
[~ ..^$]
?> ?=([@ ~] q.q.hic)
=+ dap=i.q.q.hic
=+ our=p.p.q.hic
=+ him=q.p.q.hic
=+ mes=((hard ,[@ud rook]) r.q.hic)
=< mo-abet
(mo-gawk:(mo-abed:mo our hen) him dap mes)
::
%roth
:: ~& [%gall-roth p.q.hic]
?. (~(has by pol.all) p.p.q.hic)
~& [%gall-not-ours p.q.hic]
[~ ..^$]
?> ?=([@ ~] q.q.hic)
=+ dap=i.q.q.hic
?> ?=([?(%ge %gh) @ ~] q.q.hic)
=+ dap=i.t.q.q.hic
=+ our=p.p.q.hic
=+ him=q.p.q.hic
?: ?=(%ge i.q.q.hic)
=+ mes=((hard ,[@ud rook]) r.q.hic)
=< mo-abet
(mo-gawk:(mo-abed:mo our hen) him dap mes)
=+ mes=((hard ,[@ud roon]) r.q.hic)
=< mo-abet
(mo-gawd:(mo-abed:mo our hen) him dap mes)

View File

@ -2318,6 +2318,7 @@
[%wake ~] :: timer activate
[%want p=sock q=path r=*] :: send message
[%wegh ~] :: report memory
[%west p=sack q=path r=*] :: network request
[%wont p=sock q=path r=*] :: e2e send message
== ::
::
@ -2346,6 +2347,7 @@
[%wart p=sock q=@tas r=path s=*] :: network request
[%warp p=sock q=riff] :: file request
[%wegh ~] :: report memory
[%west p=sack q=path r=*] :: network request
== ::
::
::::
@ -2454,6 +2456,7 @@
[%thud ~] :: inbound cancel
[%wart p=sack q=@tas r=_`[path *]`*gram] :: urbit message
[%wegh ~] :: report memory
[%west p=sack q=path r=*] :: network request
== ::
++ gift-eyre :: out result <-$
$% [%mass p=mass] :: memory usage
@ -2573,8 +2576,7 @@
$% [%conf p=dock q=culm] :: configure app
[%init p=ship] :: set owner
[%deal p=sock q=cush] :: full transmission
[%rote p=sack q=path r=*] :: remote request
[%roth p=sack q=path r=*] :: remote response
[%west p=sack q=path r=*] :: network request
[%wegh ~] :: report memory
== ::
++ gift-gall :: outgoing result