space-rates the lord/serf protocol

This commit is contained in:
Joe Bryan 2019-02-09 21:00:17 -05:00
parent 79d113a98d
commit 8085bf5fe6

View File

@ -33,40 +33,68 @@
} u3_serf;
static u3_serf u3V;
/* serf-lord protocol:
**
** ++ plea :: from serf to lord
** $% $: $play :: send events
** $= p ::
** %- unit :: ~ if no snapshot
** $: p=@ :: first number expected
** q=@ :: mug of state
** r=[our=@p fak=?] :: [identity fake?]
** == == ::
** $: $done :: event executed unchanged
** p/@ :: number of this event
** q/@ :: mug of state (or 0)
** r/(list ovum) :: actions
** == ::
** $: $work :: replace and retry
** p/@ :: event number
** q/@ :: mug of state (or 0)
** r/(pair date ovum) :: event
** == == ::
**
** ++ writ :: from lord to serf
** $% $: $exit :: snapshot, then exit
** p/@ :: exit code
** == ::
** $: $save :: save snapshot to disk
** p/@ :: number of old snaps to save
** == ::
** $: $work :: execute event
** p/@ :: event number
** q/@ :: mug of state (or 0)
** r/(pair date ovum) :: event
** == == ::
*/
/*
:: serf-lord protocol:
::
|%
:: +plea: from serf to lord
::
+$ plea
$% :: status on startup
::
$: %play
$= p
:: ~ if no snapshot
::
%- unit
:: p: event number expected
:: q: mug of kernel
:: r: identity, fake flag
::
[p=@ q=@ r=[our=@p fak=?]]
==
:: event executed unchanged (in response to %work)
::
$: %done
:: p: event number
:: q: mug of state (or 0)
:: r: effects
::
[p=@ q=@ r=(list ovum)]
==
:: replace event and retry (in response to %work)
::
$: %work
:: p: event number
:: q: mug of state (or 0)
:: r: replacement event (at date)
::
[p=@ q=@ r=(pair date ovum)]
== ==
:: +writ: from lord to serf
::
+$ writ
$% :: exit immediately
::
:: p: exit code
::
[%exit p=@]
:: save snapshot to disk
::
:: p: number of old snaps to save (XX not respected)
::
[%save p=@]
:: execute event
::
$: %work
:: p: event number
:: q: mug of state (or 0)
:: r: event (at date)
::
[p=@ q=@ r=(pair date ovum)]
== ==
--
*/
/* _serf_space(): print n spaces.
*/