mirror of
https://github.com/urbit/shrub.git
synced 2024-12-17 23:32:56 +03:00
lull: implement +wyt for getting the size of a |deq
This commit is contained in:
parent
9772114f6f
commit
2545e05c7a
@ -80,6 +80,15 @@
|
||||
[* * * * ~] [%4 ls]
|
||||
==
|
||||
::
|
||||
++ wyt
|
||||
|= a=(pha val)
|
||||
^- @ud
|
||||
?- -.a
|
||||
%nul 0
|
||||
%one 1
|
||||
%big :(add (lent +.p.a) (lent +.r.a) $(a q.a))
|
||||
==
|
||||
::
|
||||
++ afx-to-pha
|
||||
|= =(afx val)
|
||||
^- (pha val)
|
||||
|
@ -3092,11 +3092,6 @@
|
||||
++ packet-queue
|
||||
%- (ordered-map live-packet-key live-packet-val)
|
||||
lte-packets
|
||||
:: +live-packets: number of sent packets awaiting ack
|
||||
::
|
||||
:: ++ live-packets
|
||||
:: ^- @ud
|
||||
:: ~(wyt by live.state)
|
||||
:: +gauge: inflate a |pump-gauge to track congestion control
|
||||
::
|
||||
++ gauge (ga metrics.state ~(wyt by live.state))
|
||||
@ -3715,13 +3710,13 @@
|
||||
(call %done ok=%.y)
|
||||
--
|
||||
--
|
||||
:: +fine: construct remote scry core
|
||||
:: +fi: construct |fine remote scry core
|
||||
:: XX TODO rethink core naming/structure to follow current ames
|
||||
::
|
||||
++ fi
|
||||
=< |%
|
||||
++ fine-core .
|
||||
:: ++ pe-abed XX
|
||||
:: ++ fi-abed XX TODO
|
||||
++ fi-abet abet :: +abet:pe
|
||||
::
|
||||
:: +| %entry-points
|
||||
@ -4017,7 +4012,7 @@
|
||||
=. cor (ke-send:cor hoot.want)
|
||||
[`want | cor]
|
||||
::
|
||||
++ ke-gauge (ga metrics.keen 0) :: XX implement length deq
|
||||
++ ke-gauge (ga metrics.keen (wyt:ke-deq wan.keen))
|
||||
::
|
||||
++ ke-timer-wire
|
||||
`wire`(welp /fine/behn/wake/(scot %p her) path)
|
||||
|
@ -20,6 +20,12 @@
|
||||
(tap:de big)
|
||||
(expect-eq !>(ls) !>(big-list))
|
||||
::
|
||||
++ test-wyt
|
||||
=/ le
|
||||
~> %bout.[1 %wyt]
|
||||
(wyt:de big)
|
||||
(expect-eq !>(le) !>(big-num))
|
||||
::
|
||||
++ test-left
|
||||
^- tang
|
||||
=/ bar
|
||||
|
Loading…
Reference in New Issue
Block a user