Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Fuco1
Copy link
Contributor

@Fuco1 Fuco1 commented Mar 8, 2023

This patch fixes the async-send from child to parent. I've added a process filter to go through the child output and on getting a base-64 message I try to parse it and then read the (maybe) sexp, and then use the async-callback to dispatch it to the parent.

This implements and fixes the test-5 where it first receives message from the client, than waits a bit and then exists.

@Fuco1 Fuco1 force-pushed the feature/implement-child-messages branch from ae94455 to 331ab85 Compare March 8, 2023 21:55
async.el Outdated
(with-current-buffer (process-buffer proc)
(when async-callback
(funcall async-callback msg-decoded)))))
(error "end of file")))))
Copy link

@basil-conto basil-conto Mar 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error in this case is a handler, not a function. Is this meant to raise an error instead? If not, what's the purpose of returning the string "end of file" from this process filter? BTW, there is also a standard end-of-file error symbol, in case that should be caught/raised instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm super sleep deprived, thanks for the review!

Indeed I ment to catch end-of-file, this happens when we read and reach the end of the chunk the process sent at this moment.

I think errors can just "bubble up" as this code runs in the parent Emacs process. Although handling errors from process filters is a bit tricky and meh overall :/

@Fuco1 Fuco1 force-pushed the feature/implement-child-messages branch from 331ab85 to a982ab7 Compare March 9, 2023 01:01
@Fuco1 Fuco1 requested a review from basil-conto March 9, 2023 01:02
@Fuco1
Copy link
Contributor Author

Fuco1 commented Mar 9, 2023

@thierryvolpiatto
Copy link
Collaborator

Nice feature, looks good to merge for me, if no other comments from @basil-conto or @jwiegley I will merge soon.
Thanks.

@thierryvolpiatto thierryvolpiatto merged commit 3bd17d5 into jwiegley:master Mar 9, 2023
@thierryvolpiatto
Copy link
Collaborator

Ok merged, thanks all!

@Fuco1
Copy link
Contributor Author

Fuco1 commented Mar 9, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants