all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: 宋文武 <iyzsong@member.fsf.org>
Cc: guix-devel@gnu.org
Subject: Re: [WIP][PATCH] download: Don't report the progress too fast
Date: Wed, 30 Aug 2017 10:45:51 +0200	[thread overview]
Message-ID: <87shg978ao.fsf@gnu.org> (raw)
In-Reply-To: <87d17ilhzq.fsf@member.fsf.org> ("宋文武"'s message of "Sat, 26 Aug 2017 18:51:21 +0800")

Hello 宋文武,

iyzsong@member.fsf.org (宋文武) skribis:

> Hello, our progress report of 'guix download' can refresh too fast.  For
> example, it blinks much with this script:

Indeed, that’s always annoyed me.  I’m glad you’re looking at it!

> I'd like limiting its rate to render every 300ms.  So I write a
> higher-order function that does nothing when the previous invocation not
> happened some time (the interval) ago.  For lacking a proper name in my
> mind, I just call it 'rate-limited'.  Then using it to modify the
> 'progress-proc', let it render every 300ms.
>
> It seems working as I want, but will lost the last report, the progress
> will never finish to 100%...  There is no way to know a report is the
> last or not in the 'progress-proc' with only the 'transferred' parameter
> when the 'size' of file is unknown.

What about sacrificing elegance, and instead put that logic directly in
‘progress-proc’ itself, where we know whether we’re at 100% or not?  I’m
very much in favor of pragmatic choices in such circumstances.

(Also, longer-term, we’d want to do that other way around, which is to
update the report every N milliseconds, as opposed to just printing
something when a chunk has been transferred.)

WDYT?

Ludo’.

  reply	other threads:[~2017-08-30  8:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-26 10:51 [WIP][PATCH] download: Don't report the progress too fast 宋文武
2017-08-30  8:45 ` Ludovic Courtès [this message]
2017-09-08 15:12   ` 宋文武
2017-09-10 21:25     ` Ludovic Courtès
2017-09-14 14:20       ` 宋文武
2017-09-16  6:27         ` 宋文武
2017-09-19 11:34           ` Ludovic Courtès
2017-09-20 12:04             ` 宋文武
2017-09-19 11:32         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87shg978ao.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=iyzsong@member.fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.