From fc74ab2dbd87040c0f4397ec857f6550715cc041 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Wed, 27 Nov 2019 15:58:38 -0800 Subject: [PATCH] ames: count unsent messages for backpressure --- pkg/arvo/sys/vane/ames.hoon | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 8137ebdbc..e654759ab 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -1662,7 +1662,16 @@ |- ^- ? ?~ pumps %.n - =. acc (add acc (sub [next current]:i.pumps)) + =. acc + %+ add acc + %+ add + :: in-flight messages + :: + (sub [next current]:i.pumps) + :: queued messages + :: + ~(wyt in unsent-messages.i.pumps) + :: ?: (gte acc 5) %.y $(pumps t.pumps)