From: "Ludovic Courtès" <ludo@gnu.org>
To: 宋文武 <iyzsong@envs.net>
Cc: 62584@debbugs.gnu.org
Subject: [bug#62584] [PATCH] services: Add error/success service type.
Date: Sat, 01 Apr 2023 18:51:17 +0200 [thread overview]
Message-ID: <87pm8nfsvu.fsf_-_@gnu.org> (raw)
In-Reply-To: <87y1nbevqp.fsf@envs.net> ("宋文武"'s message of "Sat, 01 Apr 2023 18:34:54 +0800")
Hi 宋文武,
宋文武 <iyzsong@envs.net> skribis:
> Ludovic Courtès <ludo@gnu.org> writes:
>
>> I think it’s good to have it by default, but that’s something we can
>> discuss.
>
> Okay, I don't think so...
Well, naming and defaults are two hard issues in programming.
>> +(define (error/success-boot-gexp _)
>> + #~(begin
>> + (display "error in finalization thread: Success\n"
>> + (current-error-port))
>> + (sleep 2))) ;let the user notice--all this hasn't been in vain
>
> How about make the message and delay customable?
>
> I prefer "No error in finalization thread: Success",
> and 2 seconds may not be enough for a slow reader like me!
Ah yes, good points! We could probably have a configuration record like
we do for other services. That way, one could write, say:
(service error/success-service-type
(error/success-configuration
(errno EINVAL)
(message-type 'no-error)
(delay 10)))
I’d prefer to leave that for a subsequent patch though, so we can first
restore the previous situation.
>> +(define error/success-service-type
>> + (service-type
>> + (name 'error/success)
>> + (extensions
>> + (list (service-extension boot-service-type
>> + error/success-boot-gexp)))
>> + (default-value 42)
>
> What are this 42 is for?
It’s currently unused but increases the chances that it’ll give the
right answer.
Thanks for your feedback!
Ludo’.
next prev parent reply other threads:[~2023-04-01 16:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-01 7:28 [bug#62584] [PATCH] services: Add error/success service type Ludovic Courtès
2023-04-01 10:34 ` 宋文武 via Guix-patches via
2023-04-01 16:51 ` Ludovic Courtès [this message]
2023-04-01 16:52 ` Ludovic Courtès
2023-04-02 13:32 ` Ludovic Courtès
2023-04-03 9:48 ` 宋文武 via Guix-patches via
2023-04-04 10:59 ` Simon Tournier
2023-04-27 3:53 ` Jakob Honal
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=87pm8nfsvu.fsf_-_@gnu.org \
--to=ludo@gnu.org \
--cc=62584@debbugs.gnu.org \
--cc=iyzsong@envs.net \
/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.