-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
redirect stdin to frontends #42
Comments
@loladiro, once I've done |
I'm actually not sure that's possible (assuming you also want this to work for things trying to read the file descriptor. Do you know of a C API that does this? |
I don't know, but that doesn't mean much as I almost never work with asynchronous I/O. At the very least, we could make it work for ordinary Julia-based I/O: |
Also, we may need a way to throw an exception to the task that is attempting to read from |
Hmm, doing a @loladiro or @JeffBezanson, any suggestions on how to make this work for stdin from Julia tasks (never mind about external libraries for now)? |
(I'd like to at least get |
Prompting the user is a legacy behavior in BinDeps – up-to-date packages shouldn't do that. |
I see; still, I'd like to have some idea of how we can handle stdin redirection before the 0.2 feature-freeze happens. |
Until |
Well, you can always type textual input into the terminal where you launched It looks like the best thing for now would be to give up on a general solution for redirecting all stdin, due to the obstacles described above, and just hack it to make |
Sounds good to me. |
@minrk, @Carreau, I've hacked IJulia so that What am I missing? This is the log of what I am sending (prior to translation into JSON format):
|
Not sure why the notebook itself wouldn't support it, but in the messaging protocol, there is this little blurb I remember reading:
In the execute_request message. |
Except
|
That key was added because the notebook didn't support stdin requests, but it does in 1.0, so that wouldn't be the issue. @stevengj can I see what you are working on? The most likely way to lose the message is that you must specify the same zmq IDENTITY prefix on the stdin_request as you would the execute_reply. |
@minrk, thanks that fixed it! For future reference, could you clarify this in the messaging-protocol docs for |
With the latest commit, |
note added in messaging docs |
We should use @loladiro's new
redirect_stdin
request to turnSTDIN
into a zmq socket: when something is trying to read from stdin, we send aninput_request
to the front-end, and write the resultinginput_reply
(which will apparently be sent one line at a time) to stdin.Update:
readline(STDIN)
works in IJulia, but it's just a hack; other stdin reads won't work.The text was updated successfully, but these errors were encountered: