@@ -61,7 +61,7 @@
61 ?+ flow=(~(get by sub) which) `0/sub
61 ?+ flow=(~(get by sub) which) `0/sub
62 ~ [~[(pine which)] 0/(~(put by sub) which ~)]
62 ~ [~[(pine which)] 0/(~(put by sub) which ~)]
63 [~ ~] [~[(pine which)] 0/sub]
63 [~ ~] [~[(pine which)] 0/sub]
64− [~ ~ [* %& * *]] [~[(pine which)] 0/sub]
64+ [~ ~ [* %& * *]] [~[(scry `+(aeon.u.u.flow) which)] 0/sub]
66 ++ quit (corl (lead %0) ~(del by sub)) :: Unsub from [ship dude path].
66 ++ quit (corl (lead %0) ~(del by sub)) :: Unsub from [ship dude path].
67 ++ read :: See current subscribed states.
67 ++ read :: See current subscribed states.
@@ -95,7 +95,7 @@
96 =. stale.u.u.flow &
96 =. stale.u.u.flow &
97 :_ 0/(~(put by sub) current u.flow)
97 :_ 0/(~(put by sub) current u.flow)
98− ~[(on-rock-poke fake=& current u.u.flow ~)]
98+ ~[(on-rock-poke current u.u.flow ~)]
101 :_ 0/(~(del by sub) current) :_ ~
101 :_ 0/(~(del by sub) current) :_ ~
@@ -105,53 +105,77 @@
105 [path ship dude]:current
105 [path ship dude]:current
108+ :: :: Check if we're still interested
109+ :: :: in a wave. If no, no-op.
111+ ++ behn :: (See https://gist.github.com/belisarius222/7f8452bfea9b199c0ed717ab1778f35b)
112+ |= [ship=term =dude aeon=term path=paths]
113+ ^- (list card:agent:gall)
114+ %- fall :_ ~ %- mole |.
115+ =/ ship (slav %p ship)
116+ =/ aeon (slav %ud aeon)
117+ ?: (lte aeon aeon:(fall (~(got by sub) ship dude path) *flow)) ~
118+ ~[(scry `aeon ship dude path)]
108 ++ apply :: Handle response from publisher.
120 ++ apply :: Handle response from publisher.
109 |= res=(response:poke lake paths)
121 |= res=(response:poke lake paths)
110 ^- (quip card:agent:gall subs)
122 ^- (quip card:agent:gall subs)
123+ %- fall :_ `0/sub %- mole |.
111 =* current [src.bowl dude.res path.res]
124 =* current [src.bowl dude.res path.res]
112 =/ old=flow (fall (~(got by sub) current) *flow)
125 =/ old=flow (fall (~(got by sub) current) *flow)
113− ?: ?=(%tomb what.res)
127+ %tomb
114 =/ =flow old(stale &)
128 =/ =flow old(stale &)
115 :_ 0/(~(put by sub) current `flow) :_ ~
129 :_ 0/(~(put by sub) current `flow) :_ ~
116− (on-rock-poke fake=& current flow ~)
130+ (on-rock-poke current flow ~)
134+ (pine src.bowl dude.res path.res)
138+ (behn-s25 [dude aeon path]:res)
118− =/ [wave=(unit wave:lake) new=(unit flow)]
141+ =/ [wave=(unit wave:lake) =flow]
119− ?- what.res
142+ ?- what.res
120− %rock ?: (lte aeon.res aeon.old) [~ ~]
143+ %rock ?> (gte aeon.res aeon.old)
121− [~ `[aeon.res | | rock.res]]
144+ [~ [aeon.res | | rock.res]]
122− %wave ?: (lte aeon.res aeon.old) [~ ~]
123− ?> =(aeon.res +(aeon.old))
145+ %wave ?> =(aeon.res +(aeon.old))
124− [`wave.res `[aeon.res | | (wash:lake rock.old wave.res)]]
146+ [`wave.res [aeon.res | | (wash:lake rock.old wave.res)]]
148+ :_ 0/(~(put by sub) current `flow)
149+ :~ (on-rock-poke current flow wave)
150+ (scry `+(aeon.res) src.bowl dude.res path.res)
126− ?~ new `0/sub
152+ ==
127− :_ 0/(~(put by sub) current new) :_ ~
128− (on-rock-poke fake=& current u.new wave)
130− ++ handle-fake-on-rock
131− |= =(on-rock:poke lake paths)
132− ^- (list card:agent:gall)
133− ?~ flow=(~(get by sub) [src from path]:on-rock) ~
135− ?. =([stale fail rock]:u.u.flow [stale fail rock]:on-rock) ~
136− ~[(on-rock-poke fake=| [src from path]:on-rock u.u.flow wave.on-rock)]
138 :: Non-public facing arms below
154 :: Non-public facing arms below
140− ++ pine
156+ ++ behn-s25
157+ |= [=dude =aeon path=noun]
159+ :* %pass (zoom behn/(scot %p src.bowl)^dude^(scot %ud aeon)^path)
160+ %arvo %b %wait (add ~s25 now.bowl)
162+ ++ pine |= [ship dude paths] (scry ~ +<)
141− |= [who=ship which=dude where=paths]
164+ |= [when=(unit aeon) who=ship which=dude where=paths]
142 ^- card:agent:gall
165 ^- card:agent:gall
166+ =/ when ?~ when ~ (scot %ud u.when)
143− :* %pass (zoom scry-request/(scot %p who)^which^where)
167+ :* %pass (zoom scry-request/(scot %p who)^which^when^where)
144 %agent [who which]
168 %agent [who which]
145− %poke sss-to-pub/[result-type `result`[where dap.bowl]]
169+ %poke %sss-to-pub :- result-type ^- result
170+ [where dap.bowl ^when]
147 ++ on-rock-poke
172 ++ on-rock-poke
148− |= [fake=? [=ship =dude path=paths] flow wave=(unit wave:lake)]
173+ |= [[=ship =dude path=paths] flow wave=(unit wave:lake)]
149 ^- card:agent:gall
174 ^- card:agent:gall
150− :* %pass %+ zoom ?:(fake %fake %on-rock)
151− (scot %ud aeon)^(scot %p ship)^dude^path
175+ :* %pass (zoom on-rock/(scot %ud aeon)^(scot %p ship)^dude^path)
152 %agent [our dap]:bowl
176 %agent [our dap]:bowl
153− %poke ?:(fake %sss-fake-on-rock %sss-on-rock)
177+ %poke %sss-on-rock on-rock-type ^- from
154− on-rock-type `from`[path ship dude stale fail rock wave]
178+ [path ship dude stale fail rock wave]
157++ du :: Manage publications.
181++ du :: Manage publications.
@@ -160,78 +184,28 @@
161 +$ into (request:poke paths)
185 +$ into (request:poke paths)
162 +$ result (response:poke lake paths)
186 +$ result (response:poke lake paths)
164− [horizon=(unit @ud) frequency=@ud] :: Retention policy
187+ +$ rule [rocks=_1 waves=_5] :: Retention policy
166 $: rok=((mop aeon rock:lake) gte)
189 $: rok=((mop aeon rock:lake) gte)
167 wav=((mop aeon wave:lake) lte)
190 wav=((mop aeon wave:lake) lte)
169− mem=(jug ship dude)
192+ mem=(mip ship dude @da)
172 $: tid=$~(*tide $@(aeon tide))
195 $: tid=$~(*tide $@(aeon tide))
173 alo=(unit (set ship))
196 alo=(unit (set ship))
185− %- ~(run by +.versioned)
186− |= =buoy-0:^versioned
190− ?@ tid.buoy-0 tid.buoy-0
194− ?: =(waves.rul.tid.buoy-0 0) ~
195− `(mul [+(rocks) waves]:rul.tid.buoy-0)
199− %- ~(run by mem.tid.buoy-0)
207− =< $% [%0 (map paths buoy-0)]
198+ +$ pubs [%0 (map paths buoy)]
208− [%1 (map paths buoy)]
212− $: tid=$~(*tide-0 $@(aeon tide-0))
213− alo=(unit (set ship))
216− $: rok=((mop aeon rock:lake) gte)
217− wav=((mop aeon wave:lake) lte)
218− rul=[rocks=@ud waves=@ud]
219− mem=(mip ship dude @da)
224− |= [pub=versioned:pubs =bowl:gall result-type=type]
200+ |= [pub=pubs =bowl:gall result-type=type]
225− => .(pub +:(update:pubs pub))
201+ => .(pub +.pub)
226 =* rok ((on aeon rock:lake) gte)
202 =* rok ((on aeon rock:lake) gte)
227 =* wav ((on aeon wave:lake) lte)
203 =* wav ((on aeon wave:lake) lte)
229 ++ rule :: Set new retention policy.
205 ++ rule :: Set new retention policy.
230 |= [path=paths =^rule]
206 |= [path=paths =^rule]
233− %- fall :_ (~(put by pub) path %*(. *$<(aeon buoy) rul.tid rule))
235 %+ ~(jab by pub) path
209 %+ ~(jab by pub) path
237 ?@ tid.buoy buoy
211 ?@ tid.buoy buoy
@@ -240,11 +214,11 @@
240 ++ wipe :: Create new rock and wipe rest.
214 ++ wipe :: Create new rock and wipe rest.
241 |= path=paths
215 |= path=paths
244 %+ ~(jab by pub) path
218 %+ ~(jab by pub) path
246 ?@ tid.buoy buoy
220 ?@ tid.buoy buoy
247− %* . buoy(tid (form tid.buoy(rul [`0 1])))
221+ %* . buoy(tid (form tid.buoy(rul [0 1])))
248 rul.tid rul.tid.buoy
222 rul.tid rul.tid.buoy
249 wav.tid ~
223 wav.tid ~
@@ -253,45 +227,23 @@
253 ^- (quip card:agent:gall pubs)
227 ^- (quip card:agent:gall pubs)
254 ?~ ((soft ^path) path) ~| %need-path !!
228 ?~ ((soft ^path) path) ~| %need-path !!
255 =/ buoy (~(gut by pub) path *buoy)
229 =/ buoy (~(gut by pub) path *buoy)
256− =? buoy ?=(@ tid.buoy)
230+ ?@ tide=tid.buoy ~| %dead-path !! ::TODO is this good behavior?
257− %*(. buoy(tid *tide) rok.tid (put:rok ~ +(tid.buoy) *rock:lake))
260 =/ next=aeon +((latest tide))
231 =/ next=aeon +((latest tide))
262− %+ turn ~(tap by mem.tide)
232+ :- %+ murn ~(tap bi mem.tide)
263− |= [=ship =(set dude)]
233+ |= [=ship =dude =@da]
264− %+ turn ~(tap in set)
234+ ?: (lth da now.bowl) ~
266− (send wave/[next wave] ship dude path)
235+ `(send scry/wave/wave ship dude next path)
268 %+ ~(put by pub) path
237 %+ ~(put by pub) path
269 =/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
238 =/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
270 =. wav.tide (put:wav wav.tide next wave)
239 =. wav.tide (put:wav wav.tide next wave)
271− =. mem.tide ~
240+ =. mem.tide (~(del by mem.tide) next)
272− ?. =(next (add aeon.last frequency.rul.tide)) buoy
241+ ?. =(next (add aeon.last waves.rul.tide)) buoy
273 buoy(tid (form tide))
242 buoy(tid (form tide))
275− ++ fork :: Fork a pub into an empty path.
276− |= [from=paths to=paths]
279− ?< (~(has by pub) to)
280− (~(put by pub) to (~(got by pub) from))
282− ++ copy :: Fork a sub into an empty path.
283− |= [sub=_(mk-subs lake *) from=[ship dude *] to=paths]
286− ?< (~(has by pub) to)
289− rok.tid (put:rok ~ [aeon rock]:(need (~(got by +:sub) from)))
292 ++ perm :: Change permissions with gate.
244 ++ perm :: Change permissions with gate.
293 |= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))]
245 |= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))]
294− ^- (quip card:agent:gall pubs)
246+ ^- pubs
295 %+ edit where
247 %+ edit where
297 =/ new=_alo.buoy (diff alo.buoy)
249 =/ new=_alo.buoy (diff alo.buoy)
@@ -300,21 +252,21 @@
301 mem.tid ?~ new mem.tid.buoy
253 mem.tid ?~ new mem.tid.buoy
302 %. mem.tid.buoy
254 %. mem.tid.buoy
303− ~(int by (malt (turn ~(tap in u.new) (late *(set @)))))
255+ ~(int by (malt (turn ~(tap in u.new) (late *(map @ @)))))
305 ++ public (curr perm _~) :: Make list of paths public.
257 ++ public (curr perm _~) :: Make list of paths public.
306 ++ secret (curr perm _`~) :: Make list of paths secret.
258 ++ secret (curr perm _`~) :: Make list of paths secret.
307 :: :: Block ships from paths.
259 :: :: Block ships from paths.
308 ++ block :: No-ops on public paths.
260 ++ block :: No-ops on public paths.
309 |= [who=(list ship) whence=(list paths)]
261 |= [who=(list ship) whence=(list paths)]
310− ^- (quip card:agent:gall pubs)
262+ ^- pubs
311 %+ perm whence
263 %+ perm whence
312 |= old=(unit (set ship))
264 |= old=(unit (set ship))
313 ?~ old ~ `(~(dif in u.old) (sy who))
265 ?~ old ~ `(~(dif in u.old) (sy who))
314 :: :: Allow ships to paths.
266 :: :: Allow ships to paths.
315 ++ allow :: Any public paths will no-op.
267 ++ allow :: Any public paths will no-op.
316 |= [who=(list ship) where=(list paths)]
268 |= [who=(list ship) where=(list paths)]
317− ^- (quip card:agent:gall pubs)
269+ ^- pubs
318 %+ perm where
270 %+ perm where
319 |= old=(unit (set ship))
271 |= old=(unit (set ship))
320 ?~ old ~ `(~(gas in u.old) who)
272 ?~ old ~ `(~(gas in u.old) who)
@@ -322,6 +274,12 @@
322 ++ kill :: subs to not expect updates.
274 ++ kill :: subs to not expect updates.
323 (curr edit |=(=buoy buoy(tid (latest tid.buoy))))
275 (curr edit |=(=buoy buoy(tid (latest tid.buoy))))
324 :: :: Reopen list of killed paths.
276 :: :: Reopen list of killed paths.
277+ ++ live :: No-ops on live paths.
281+ %*(. buoy(tid *tide) rok.tid (put:rok ~ +(tid.buoy) *rock:lake))
325 ++ read :: See current published states.
283 ++ read :: See current published states.
326 ^- (map paths [allowed=(unit (set ship)) =rock:lake])
284 ^- (map paths [allowed=(unit (set ship)) =rock:lake])
327 %- malt %+ murn ~(tap by pub)
285 %- malt %+ murn ~(tap by pub)
@@ -341,51 +299,37 @@
341 =/ =buoy (~(gut by pub) path.req *buoy)
299 =/ =buoy (~(gut by pub) path.req *buoy)
342 ?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
300 ?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
343 ?@ tid.buoy
301 ?@ tid.buoy
344− :_ 1/pub :_ ~
302+ :_ 0/pub :_ ~
345− (send tomb/~ src.bowl dude.req path.req)
303+ (send tomb/~ src.bowl dude.req tid.buoy path.req)
346− :_ 1/pub :_ ~
304+ ?~ when.req
347− =/ last (fall (pry:rok rok.tid.buoy) *[=key =val]:rok)
305+ =/ last (fall (pry:rok rok.tid.buoy) *[=key =val]:rok)
348− (send rock/last src.bowl dude.req path.req)
351− |= [[ship=term =dude aeon=term path=paths] =sign:agent:gall]
352− ^- (quip card:agent:gall pubs)
353− ?> ?=(%poke-ack -.sign)
355− =/ =buoy (~(gut by pub) path *buoy)
356− ?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
358− :_ 1/pub :_ ~
306+ :_ 0/pub :_ ~
359− (send tomb/~ src.bowl dude path)
307+ (send scry/rock/val.last src.bowl dude.req key.last path.req)
361− => .(aeon +((slav %ud aeon)))
362− ?^ dat=(get:wav wav.tid.buoy aeon)
308+ ?^ dat=(get:wav wav.tid.buoy u.when.req)
363− :_ 1/pub :_ ~
309+ :_ 0/pub :_ ~
364− (send wave/[aeon u.dat] src.bowl dude path)
310+ (send scry/wave/u.dat src.bowl [dude u.when path]:req)
365− =/ last (fall (pry:rok rok.tid.buoy) [=key =val]:rok)
311+ ?: %+ lte u.when.req
366− ?: (lte aeon key.last)
312+ key::(fall (ram:wav wav.tid.buoy) (pry:rok rok.tid.buoy) [=key val]:wav)
367− :_ 1/pub :_ ~
313+ :_ 0/pub :_ ~
368− (send rock/last src.bowl dude path)
314+ (send yore/~ src.bowl [dude u.when path]:req)
369− :- ~
315+ ?> =(u.when.req +((latest tid.buoy)))
370− :- %1
316+ :- ~[(send nigh/~ src.bowl [dude u.when path]:req)]
371− %+ ~(put by pub) path
318+ %+ ~(put by pub) path.req
373− mem.tid (~(put ju mem.tid.buoy) src.bowl dude)
320+ mem.tid (~(put bi mem.tid.buoy) src.bowl dude.req (add ~s25 now.bowl))
376 :: Non-public facing arms below
323 :: Non-public facing arms below
379− |= [payload=_|2:*(response:poke lake paths) =ship =dude path=paths]
326+ |= [payload=_|3:*(response:poke lake paths) =ship =dude =aeon path=paths]
380 ^- card:agent:gall
327 ^- card:agent:gall
381 =* mark (cat 3 %sss- name:lake)
328 =* mark (cat 3 %sss- name:lake)
382− =/ callback=^path
329+ :* %pass (zoom scry-response/(scot %p ship)^dude^(scot %ud aeon)^path)
383− ?: ?=(%tomb what.payload) (zoom tomb-response/(scot %p ship)^dude^path)
384− (zoom scry-response/(scot %p ship)^dude^(scot %ud aeon.payload)^path)
386 %agent [ship dude]
330 %agent [ship dude]
387 %poke mark result-type ^- (response:poke lake paths)
331 %poke mark result-type ^- (response:poke lake paths)
388− [path dap.bowl payload]
332+ [path dap.bowl aeon payload]
390 ++ latest
334 ++ latest
391 |= =$@(aeon tide)
335 |= =$@(aeon tide)
@@ -396,49 +340,31 @@
398 |= [ps=(list paths) edit=$-(buoy buoy)]
342 |= [ps=(list paths) edit=$-(buoy buoy)]
399− ^- (quip card:agent:gall pubs)
343+ ^- pubs
400 %- ~(rep in (sy ps))
345 %- ~(rep in (sy ps))
401− |= [path=paths caz=(list card:agent:gall) %1 =_pub]
346+ |= [path=paths =_pub]
347+ %- fall :_ pub %- mole |.
402− ?~ old=(~(get by pub) path) [caz 1/pub]
348+ (~(jab by pub) path edit)
403− =/ new=buoy (edit u.old)
404− :_ 1/(~(put by pub) path new)
406− ^- (list card:agent:gall)
410− %+ turn ~(tap by mem.tid.u.old)
411− |= [=ship =(set dude)]
412− (turn ~(tap in set) |=(=dude (send tomb/~ ship dude path)))
414− =/ new-alo=(jug ship dude)
415− (malt (turn ~(tap in u.alo.new) (late *(set @))))
417− %+ turn ~(tap by (~(dif by mem.tid.u.old) new-alo))
418− |= [=ship =(set dude)]
419− (turn ~(tap in set) |=(=dude (send tomb/~ ship dude path)))
424 =/ max-rock=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
353 =/ max-rock=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
425 =/ max-wave (fall (bind (ram:wav wav.tide) head) 0)
354 =/ max-wave (fall (bind (ram:wav wav.tide) head) 0)
426− =? rok.tide :: Create new rock.
355+ =. rok.tide
356+ %+ gas:rok +<-:gas:rok
357+ %- tab:rok :_ [~ +(rocks.rul.tide)]
427− ?& !=(frequency.rul.tide 0)
358+ ?: ?| =(waves.rul.tide 0)
428− (gte max-wave (add aeon.max-rock frequency.rul.tide))
359+ (lth max-wave (add aeon.max-rock waves.rul.tide))
430 %+ put:rok rok.tide
362 %+ put:rok rok.tide
431 %+ roll (tab:wav wav.tide `aeon.max-rock max-wave)
363 %+ roll (tab:wav wav.tide `aeon.max-rock max-wave)
432 |: [*[now=aeon =wave:lake] `[prev=aeon =rock:lake]`max-rock]
364 |: [*[now=aeon =wave:lake] `[prev=aeon =rock:lake]`max-rock]
433 ~| %aeon-awry
365 ~| %aeon-awry
434 ?> =(now +(prev))
366 ?> =(now +(prev))
435 [now (wash:lake rock wave)]
367 [now (wash:lake rock wave)]
437− ?~ horizon.rul.tide :: Only keep genesis and latest.
438− (gas:rok ~ (murn ~[(ram:rok rok.tide) (pry:rok rok.tide)] same))
439− %^ lot:rok rok.tide :: Delete beyond horizon.
441− (mole |.((sub max-wave (max [u.horizon frequency]:rul.tide))))
442 ~| %rock-zero
368 ~| %rock-zero
443 tide(wav (lot:wav wav.tide (bind (ram:rok rok.tide) |=([r=@ *] (dec r))) ~))
369 tide(wav (lot:wav wav.tide (bind (ram:rok rok.tide) |=([r=@ *] (dec r))) ~))