mirror of
https://github.com/urbit/shrub.git
synced 2024-11-23 20:26:54 +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)
|
||||
|
@ -9,17 +9,23 @@
|
||||
(apl:de *(pha @) big-list)
|
||||
=/ foo-list (gulf 1 8)
|
||||
|%
|
||||
++ foo
|
||||
++ foo
|
||||
(apl:de *(pha @) 1 2 3 4 5 6 7 8 ~)
|
||||
++ bar
|
||||
++ bar
|
||||
`(pha @)`(apl:de *(pha @) 8 9 10 11 12 13 14 15 ~)
|
||||
::
|
||||
++ test-tap
|
||||
=/ ls
|
||||
=/ ls
|
||||
~> %bout.[1 %tap]
|
||||
(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
|
||||
@ -29,7 +35,7 @@
|
||||
~> %bout.[1 %apl]
|
||||
(apl:de bar 1 2 3 4 5 6 ~)
|
||||
%- zing
|
||||
:-
|
||||
:-
|
||||
~> %bout.[1 %eq-1]
|
||||
(expect-eq !>((tap:de bar)) !>((gulf 1 15)))
|
||||
=^ val=(unit @) bar
|
||||
|
Loading…
Reference in New Issue
Block a user