mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-17 11:51:32 +03:00
better encapsulation of poll delays
This commit is contained in:
parent
5cb05ddd44
commit
39a6455001
@ -78,6 +78,10 @@
|
||||
[~ ran]
|
||||
[`tym (~(put by ran) pax ?~(cur 0 (min 5 +(p.u.cur))) tym)]
|
||||
::
|
||||
++ wait-new :: poll with min delay
|
||||
|= {pax/path mof/(list move)}
|
||||
(wait(ran (~(del by ran) pax)) pax mof)
|
||||
::
|
||||
++ wait :: ensure poll by path
|
||||
|= {pax/path mof/(list move)} ^+ done
|
||||
=^ tym ran (dely pax)
|
||||
@ -93,10 +97,8 @@
|
||||
|= {usr/knot act/command} ^+ done
|
||||
?- -.act
|
||||
$post
|
||||
=: out (~(put by out) p.act %& usr q.act)
|
||||
ran (~(del by ran) /peer/home)
|
||||
==
|
||||
%+ wait /peer/home
|
||||
=. out (~(put by out) p.act %& usr q.act)
|
||||
%+ wait-new /peer/home
|
||||
=+ req=[%twit-req `endpoint`stat-upda+[%status q.act]~ ~]
|
||||
[ost %hiss post+(dray ~[%uv] p.act) `usr %twit-status req]~
|
||||
==
|
||||
@ -111,7 +113,7 @@
|
||||
pus=(~(gas ju *(jug path bone)) (turn (~(tap by sup)) .))
|
||||
?~ (~(get ju pus) pax)
|
||||
~
|
||||
~& peer-again+[pax ran]
|
||||
~& peer-again+[pax ran]
|
||||
(pear | `~. pax) ::(user-from-path pax))
|
||||
::
|
||||
:: XX parse from stack trace?
|
||||
@ -140,15 +142,13 @@
|
||||
:: ~& got-feed+[(scag 5 (turn rep |=(stat id))) fed]
|
||||
=+ ren=(cull pax rep) :: new messages
|
||||
=. rep (weld ren (~(get ja fed) pax))
|
||||
=: fed (~(put by fed) pax rep) :: save full list
|
||||
ran (~(del by ran) wir) :: clear poll delay
|
||||
==
|
||||
=. fed (~(put by fed) pax rep) :: save full list
|
||||
?: ?=($scry -.wir)
|
||||
[(spam scry+x+pax [%diff twit-feed+(flop rep)] [%quit ~] ~) +>.$]
|
||||
?~ ren
|
||||
(wait wir ~) :: pump polling
|
||||
:: ~& spam-feed+ren
|
||||
(wait wir (spam pax [%diff twit-feed+(flop ren)] ~))
|
||||
(wait-new wir (spam pax [%diff twit-feed+(flop ren)] ~))
|
||||
::
|
||||
++ sigh-tang :: Err
|
||||
|= {pax/path tan/tang} ^+ done
|
||||
@ -276,7 +276,7 @@
|
||||
|= {a/path b/(list gift)} ^- (list move)
|
||||
%- zing ^- (list (list move))
|
||||
~& spam+[(turn b head) a]
|
||||
~& sup
|
||||
~& (skim (~(tap by sup)) |=({@ @ pax/path} =(pax a)))
|
||||
%+ turn (~(tap by sup))
|
||||
|= {ost/bone @ pax/path}
|
||||
?. =(pax a) ~
|
||||
|
Loading…
Reference in New Issue
Block a user