-
Notifications
You must be signed in to change notification settings - Fork 93
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
Attempt fixing :sync #99
Conversation
hmm, so the semaphore keeps checking in with the process about whether or not it's done? I'm a little confused still as to why async calls succeed when sync calls fail -- if there is still data to retrieve via But then I don't understand async programmingvery well at all, esp not in elisp. @alphapapa are you able to review this ? |
No, the while-loop in
One, Async calls don't call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, so the semaphore keeps checking in with the process about whether or not it's done?
No, the while-loop in
request--curl-sync
does that.
ah right. and semaphore is just another way to set finished
to t, is that right?
I'm a little confused still as to why async calls succeed when sync calls fail -- if there is still data to retrieve via
accept-process-output
shouldn't async calls also have trouble?One, Async calls don't call
request--curl-sync
. Two, how do you define trouble? We don't make the same synchronous demands on async calls that we do:sync t
calls.
ok. since this is making poor wee head hurt... I will do what other people think is best. Are you able to pass all tests with yr branch?
@@ -1004,7 +1004,7 @@ temporary file paths." | |||
files)) | |||
|
|||
(cl-defun request--curl (url &rest settings | |||
&key type data files headers timeout response | |||
&key type data files headers timeout response semaphore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "semaphore" a standard name for this kind of process watcher?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No? But "semaphore" is exactly what it is.
I passed travis on the first attempt: https://travis-ci.org/tkf/emacs-request/builds/461595586 I appear not to be passing now. It a'int easy being green. |
I took a look and posted a few comments. I don't feel like I am familiar enough with Emacs's process-interacting code to pass judgement on it, but if @dickmao is, and if the tests pass, and if it seems to fix the bug, then great! :) |
|
Done. |
See dickmao's comment in #92 regarding why
:sync
does not behave asexpected.
Previously,
request--curl-sync
would merely return as soon as thecurl process finished without regard to
#'request--curl-callback
. This change attaches the semaphore to theright place.
(Attempt) Fixes #92