unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
Cc: guile-user@gnu.org
Subject: [PATCH] fibers: operations for waiting until port is readable / writable
Date: Sun, 14 Mar 2021 18:13:23 +0100	[thread overview]
Message-ID: <ed8084c78c200b6efd1b8cfff64b2b18e037edbc.camel@telenet.be> (raw)

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

Hi guilers!

This is a patch to guile-fibers that adds
a ‘wait-until-port-readable-operation’ and
‘wait-until-port-writable-operation’ that can
be used to wait until a port (backed by a fd)
becomes readable or writabble respectively.

These operations can be used in combination
with e.g. get-operation, wait-operation and
sleep-operation using choice-operation.
Might be useful for implementing time-outs
and interrupts!

This is a revised version of a buggy patch I
previously posted:

<https://lists.gnu.org/archive/html/guile-user/2021-02/msg00027.html>

I found the bug: I was trying to write to an input-only
port.  That's fixed now, and wait-until-port-X-operation
now verifies the port type.  I also added some documentation
and more tests.

"make distcheck" succeeds.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

                 reply	other threads:[~2021-03-14 17:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=ed8084c78c200b6efd1b8cfff64b2b18e037edbc.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=guile-user@gnu.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).