mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-03 12:42:48 +03:00
clay: defer all calls to %wick
This commit is contained in:
parent
301158c40a
commit
ebf09bd248
@ -342,7 +342,7 @@
|
||||
::
|
||||
=. tid.state (~(put by tid.state) new-tid yarn)
|
||||
?- -.source
|
||||
%& (begin-thread yarn p.source)
|
||||
%& (begin-shed yarn p.source)
|
||||
%|
|
||||
=. starting.state (~(put by starting.state) yarn [%build vase.p.source])
|
||||
=/ pax=path
|
||||
@ -371,10 +371,10 @@
|
||||
=/ maybe-thread (mule |.(!<(thread !<(vase q.r.u.riot))))
|
||||
?: ?=(%| -.maybe-thread)
|
||||
(thread-fail-not-running tid %thread-not-thread ~)
|
||||
(start-thread yarn p.maybe-thread)
|
||||
(slam-thread yarn p.maybe-thread)
|
||||
::
|
||||
++ start-thread
|
||||
~/ %start-thread
|
||||
++ slam-thread
|
||||
~/ %slam-thread
|
||||
|= [=yarn =thread]
|
||||
^- (quip card ^state)
|
||||
=/ =vase vase:(~(got by starting.state) yarn)
|
||||
@ -382,9 +382,9 @@
|
||||
?: ?=(%| -.res)
|
||||
(thread-fail-not-running (yarn-to-tid yarn) %false-start p.res)
|
||||
=. starting.state (~(del by starting.state) yarn)
|
||||
(begin-thread yarn p.res)
|
||||
(begin-shed yarn p.res)
|
||||
::
|
||||
++ begin-thread
|
||||
++ begin-shed
|
||||
|= [=yarn =shed:khan]
|
||||
?< (~(has of running.state) yarn)
|
||||
=/ m (strand ,vase)
|
||||
|
@ -1679,7 +1679,7 @@
|
||||
?> ?=(~ deletes)
|
||||
=/ data=(map path (each page lobe))
|
||||
(~(run by changes) |=(=cage &+[p q.q]:cage))
|
||||
(park | &+[~ data] *rang)
|
||||
(park | & &+[~ data] *rang)
|
||||
::
|
||||
=/ parent-tako=tako (aeon-to-tako:ze let.dom)
|
||||
=/ data=(map path (each page lobe))
|
||||
@ -1694,7 +1694,7 @@
|
||||
(~(run by changes) |=(=cage &+[p q.q]:cage))
|
||||
::
|
||||
=/ =yuki [~[parent-tako] data]
|
||||
(park | &+yuki *rang)
|
||||
(park | & &+yuki *rang)
|
||||
::
|
||||
:: Unix commit
|
||||
::
|
||||
@ -1728,7 +1728,7 @@
|
||||
++ park
|
||||
=/ check-sane |
|
||||
|^
|
||||
|= [updated=? =yoki =rang]
|
||||
|= [updated=? goat=? =yoki =rang]
|
||||
^+ ..park
|
||||
=: hut.ran (~(uni by hut.rang) hut.ran)
|
||||
lat.ran (~(uni by lat.rang) lat.ran)
|
||||
@ -1868,9 +1868,6 @@
|
||||
=. fod.dom [spill sprig]:args
|
||||
=. fad cache.args
|
||||
=. ..park (emil (print q.old-yaki data))
|
||||
:: notify unix and subscribers
|
||||
::
|
||||
=. ..park wake:?:(mem (ergo 0 mum.res) ..park)
|
||||
:: if upgrading kelvin and there's a commit-in-waiting, use that
|
||||
::
|
||||
=? ..park &(=(%base syd) !=(old-kel kel))
|
||||
@ -1888,14 +1885,20 @@
|
||||
::
|
||||
$(desks t.desks)
|
||||
=/ den ((de now rof hen ruf) our desk.i.desks)
|
||||
=^ moves-3 ruf abet:(park:den | u.wat *^rang)
|
||||
=^ moves-3 ruf abet:(park:den | | u.wat *^rang)
|
||||
=. moves-2 (weld moves-2 moves-3)
|
||||
$(desks t.desks)
|
||||
:: tell gall to try to run agents if %held
|
||||
::
|
||||
?: ?=(%held liv.dom)
|
||||
(emit hen %pass /park-held/[syd] %b %wait now)
|
||||
..park
|
||||
=. ..park
|
||||
?- liv.dom
|
||||
%held (emit hen %pass /park-held/[syd] %b %wait now)
|
||||
%dead ..park
|
||||
%live ?:(goat goad ..park)
|
||||
==
|
||||
:: notify unix and subscribers
|
||||
::
|
||||
wake:?:(mem (ergo 0 mum.res) ..park)
|
||||
::
|
||||
:: +is-kernel-path: should changing .pax cause a kernel or vane reload?
|
||||
::
|
||||
@ -2285,7 +2288,7 @@
|
||||
^+ ..take-fuse
|
||||
?~ merges
|
||||
=. ..take-fuse (done-fuse clean-state %& ~)
|
||||
(park | [%| next-yaki(p (flop parents))] rag)
|
||||
(park | & [%| next-yaki(p (flop parents))] rag)
|
||||
=/ [bec=beak g=germ] i.merges
|
||||
=/ ali-dom=dome:clay (need (~(got by sto.fiz) bec))
|
||||
=/ result (merge-helper p.bec q.bec g ali-dom `next-yaki)
|
||||
@ -2366,7 +2369,7 @@
|
||||
?~ mr
|
||||
(done %& ~)
|
||||
=. ..merge (done %& conflicts.u.mr)
|
||||
(park | new.u.mr ~ lat.u.mr)
|
||||
(park | & new.u.mr ~ lat.u.mr)
|
||||
==
|
||||
::
|
||||
+$ merge-result [conflicts=(set path) new=yoki lat=(map lobe page)]
|
||||
@ -3091,14 +3094,22 @@
|
||||
++ wick
|
||||
^+ ..park
|
||||
?> ?=(%base syd)
|
||||
(emit hen %pass /wick %b %wait now)
|
||||
::
|
||||
++ take-wick
|
||||
|= err=(unit tang)
|
||||
^+ ..park
|
||||
?^ err
|
||||
((slog leaf+"clay: desk {<syd>} failed to unsuspend" u.err) ..park)
|
||||
?> ?=(%base syd)
|
||||
=/ wis=(list [weft =yoki])
|
||||
%+ sort ~(tap by wic.dom)
|
||||
|= [a=[weft yoki] b=[weft yoki]]
|
||||
(gth num.a num.b)
|
||||
=. wis (skip wis |=([[* a=@ud] *] (gte a zuse)))
|
||||
?~ wis :: Every commit bottoms out here
|
||||
goad
|
||||
(park | yoki.i.wis *rang)
|
||||
?~ wis :: Every commit bottoms out here ?
|
||||
..park
|
||||
(park | & yoki.i.wis *rang)
|
||||
::
|
||||
:: Cancel a request.
|
||||
::
|
||||
@ -4731,7 +4742,7 @@
|
||||
%park
|
||||
=^ mos ruf
|
||||
=/ den ((de now rof hen ruf) our des.req)
|
||||
abet:(park:den | [yok ran]:req)
|
||||
abet:(park:den | & [yok ran]:req)
|
||||
[mos ..^$]
|
||||
::
|
||||
%pork
|
||||
@ -4739,7 +4750,7 @@
|
||||
=. pud.ruf ~
|
||||
=^ mos ruf
|
||||
=/ den ((de now rof hen ruf) our syd)
|
||||
abet:(park:den & yoki *rang)
|
||||
abet:(park:den & & yoki *rang)
|
||||
[mos ..^$]
|
||||
::
|
||||
%perm
|
||||
@ -4858,8 +4869,9 @@
|
||||
=^ m1 ruf
|
||||
=/ den ((de now rof hen ruf) our des.req)
|
||||
abet:(set-zest:den liv.req)
|
||||
=^ m2 ..^$ $(wrapped-task [%wick ~])
|
||||
[(weld m1 m2) ..^$]
|
||||
=^ m2 ruf abet:goad:(lu now rof hen ruf)
|
||||
=^ m3 ..^$ $(wrapped-task [%wick ~])
|
||||
[:(weld m1 m2 m3) ..^$]
|
||||
::
|
||||
%plea
|
||||
=* her ship.req
|
||||
@ -5642,6 +5654,13 @@
|
||||
abet:(take-park-held:den error.hin)
|
||||
[mos ..^$]
|
||||
::
|
||||
?: ?=([%wick ~] tea)
|
||||
?> ?=(%wake +<.hin)
|
||||
=^ mos ruf
|
||||
=/ den ((de now rof hen ruf) our %base)
|
||||
abet:(take-wick:den error.hin)
|
||||
[mos ..^$]
|
||||
::
|
||||
?: ?=([%foreign-warp *] tea)
|
||||
?> ?=(%writ +<.hin)
|
||||
:_ ..^$
|
||||
|
@ -103,14 +103,14 @@
|
||||
?>(?=([@ ~] s.beam) beam(s i.s.beam))
|
||||
::
|
||||
++ poke-spider
|
||||
|= =cage
|
||||
^- note
|
||||
[%g %deal [our our] %spider %poke cage]
|
||||
|= [hen=duct =cage]
|
||||
^- move
|
||||
[hen %pass //g %g %deal [our our] %spider %poke cage]
|
||||
::
|
||||
++ watch-spider
|
||||
|= =path
|
||||
^- note
|
||||
[%g %deal [our our] %spider %watch path]
|
||||
|= [hen=duct =path]
|
||||
^- move
|
||||
[hen %pass //g %g %deal [our our] %spider %watch path]
|
||||
--
|
||||
=| khan-state
|
||||
=* state -
|
||||
@ -134,22 +134,8 @@
|
||||
%born
|
||||
[~ khan-gate(hey hen, tic 0)]
|
||||
::
|
||||
%fard
|
||||
=/ tid=@ta
|
||||
%^ cat 3
|
||||
'khan-fyrd--'
|
||||
(scot %uv (sham (mix tic eny)))
|
||||
=. tic +(tic)
|
||||
=* fyd p.task
|
||||
=/ =beak (get-beak bear.fyd now)
|
||||
=/ args [~ `tid beak name.fyd q.args.fyd]
|
||||
:_ khan-gate
|
||||
%+ turn
|
||||
:~ (watch-spider /thread-result/[tid])
|
||||
(poke-spider %spider-start !>(args))
|
||||
==
|
||||
|=(=note ^-(move [hen %pass //g note]))
|
||||
::
|
||||
%fard (bard hen 'khan-fyrd--' bear.p.task %| [name args]:p.task)
|
||||
%lard (bard hen 'khan-lard--' bear.task %& shed.task)
|
||||
%fyrd
|
||||
=* fyd p.task
|
||||
=/ =beak (get-beak bear.fyd now)
|
||||
@ -159,22 +145,24 @@
|
||||
(slap (vale.dais q.q.args.fyd) !,(*hoon [~ u=.]))
|
||||
=- [[hen %pass wire -]~ khan-gate]
|
||||
[%k %fard bear.fyd name.fyd p.q.args.fyd vase]
|
||||
::
|
||||
%lard
|
||||
=/ tid=@ta
|
||||
%^ cat 3
|
||||
'khan-lard--'
|
||||
(scot %uv (sham (mix tic eny)))
|
||||
=. tic +(tic)
|
||||
=/ =beak (get-beak bear.task now)
|
||||
=/ args [~ `tid beak shed.task]
|
||||
:_ khan-gate
|
||||
%+ turn
|
||||
:~ (watch-spider /thread-result/[tid])
|
||||
(poke-spider %spider-inline !>(args))
|
||||
==
|
||||
|=(=note ^-(move [hen %pass //g note]))
|
||||
==
|
||||
::
|
||||
++ bard
|
||||
|= [hen=duct prefix=@ta =bear payload=(each shed [name=term args=cage])]
|
||||
^- [(list move) _khan-gate]
|
||||
=/ =tid:rand (cat 3 prefix (scot %uv (sham (mix tic eny))))
|
||||
=/ =beak (get-beak bear now)
|
||||
=/ =cage
|
||||
?- -.payload
|
||||
%& [%spider-inline !>([~ `tid beak p.payload])]
|
||||
%| [%spider-start !>([~ `tid beak [name q.args]:p.payload])]
|
||||
==
|
||||
=. tic +(tic)
|
||||
:_ khan-gate
|
||||
:~ (watch-spider hen /thread-result/[tid])
|
||||
(poke-spider hen cage)
|
||||
==
|
||||
::
|
||||
:: +load: migrate an old state to a new khan version
|
||||
::
|
||||
++ load
|
||||
|
Loading…
Reference in New Issue
Block a user