-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scheduler: Set a simple custom record printer. #82
Merged
emixa-d
merged 11 commits into
wingo:master
from
cbaines:scheduler-set-custom-record-printer
Sep 14, 2023
Merged
scheduler: Set a simple custom record printer. #82
emixa-d
merged 11 commits into
wingo:master
from
cbaines:scheduler-set-custom-record-printer
Sep 14, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Something like this would be great! Maybe it would be good to print out a few of the fields, though. The key thing to not print is the |
* fibers.texi (make-read-operation,make-write-operation): Document them. * fibers/io-wakeup.scm (make-wait-operation): Remove this-procedure argument. Instead, reuse the constructed operation object. Replace 'ready?' argument by a more generic 'try-fn' argument, moving the difference into ... (try-ready): ... this new procedure. (wait-until-port-readable-operation): Move everything except the try procedure into ... (make-read-operation): ... this new (exported) procedure. (wait-until-port-writable-operation): Likewise, move things into ... (wait-until-port-readable-operation): ... this new (exported) procedure.
In retrospect, make-x/timeout? is an independent change, but it fits and is a trivial change, so it's pointless to split it off to a new commit. * fibers.texi (with-read-waiting-is-failure,with-write-waiting-is-failure) (make-read-operation,make-write-operation,accept-operation): Define new procedures and add context. * tests/io-wakeup.scm: Test the new procedures. (readable/timeout?,writable/timeout?): Extract a new procedure ... (make-x/timeout?): ..., sharing common functionality. (accepted-socket,accept*-operation,accept*/timeout?): New stuff. (make-listening-socket): Change from datagram sockets to stream sockets because 'accept' is not a thing on datagram sockets and the new tests care about that. Also listen to the socket because a later test needs that. * fibers/io-wakeup.scm (with-read-waiting-is-failure,with-write-waiting-is-failure) (make-read-operation,make-write-operation): Implement them.
This effectively merges wingo#60, with the following changes: The commit ‘un-comment indices’ was in the future (time-wise) and previously (commit history) mostly duplicated in: commit 36a6cc7 Author: Ludovic Courtès <[email protected]> Date: Mon Feb 6 14:43:20 2023 +0100 doc: Add index. * fibers.texi (Index): New node. without mentioning the previous (time-wise) PR wingo#60. The difference between the PR and this commit is that it appears to merge the function and concept index. Another difference: it's squashed. * fibers.texi (Index): Don't mention concepts in the menu.
On old Guile versions, this makes the (cyclic) record actually printable. On both old and new Guile versions, this makes the output much less verbose. This is <wingo#82> by cbaines, with the proposal by davexunit implemented and with a test and news entry. * fibers/scheduler.scm (<scheduler>): Set a printer. * tests/basic.scm ("scheduler objects can be printed with a reasonable length:"): Test it. * NEWS: Mention it.
emixa-d
force-pushed
the
scheduler-set-custom-record-printer
branch
from
September 4, 2023 12:41
afa60a3
to
2f1060a
Compare
Implemented davexunit's proposal. |
If CI succeeds, no negative review and I don't forget, I intend to merge it in a week. |
emixa-d
added
enhancement
approved
Seems reasonable for merging, but let's give other people some time to comment.
labels
Sep 4, 2023
Looks like the conflicts in 1b0ce83 weren't fixed completely correctly. * fibers.texi: Do it.
‘send-operation’ doesn't exist! * fibers.texi (Context): Fix it. Fixes: wingo#90 Reported-by: viviicat
Closes: wingo#48 Reported-by: cireu (with some adjustments) * fibers/scheduler.scm (run-scheduler)[run-task]: Explain it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
approved
Seems reasonable for merging, but let's give other people some time to comment.
enhancement
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The default record printer in Guile seems to produce a large (maybe infinite) output for schedulers, so this simple record printer prevents that.