-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
[FEATURE]: Do you consider adding plenary.job
like feature in a nio
way?
#5
Comments
Love the idea of having an abstraction over running subprocesses though would prefer a more flexible API. I've got an initial implementation in #7, feel free to try it out (though it's still WIP)! The docs are quite sparse, I'd like to add more examples, but for now you can see the usage in the tests |
I'm not on my pc right now so I can't test it right away but I love the simplicity and also that I have the ability to pipe between multiple commands is absolutely awesome. Great job!! One FR: would it be possible to loop through each line of stdout without waiting for the command to finish? For example the output from |
Glad to hear you like it! I'll leave this change as the minimal interface for now. Reading lines (or until any separator) is relatively complex to do efficiently, and relatively trivial to do not efficiently. I'd rather get the interface "right" rather than half baked and have to deprecate things later. PRs welcome of course though For reference, here's CPython's implementation of |
Thanks @rcarriga . I can officially recommend to neo-tree now :) nvim-neo-tree/neo-tree.nvim#1342
I'm actually surprised that this mechanism was implemented in python and not directly modifying the stream inside internal C code. So, from what I understand, in the below code, lua will run until local first = nio.process.run({
cmd = "printf", args = { "hello" }
})
local second = nio.process.run({
cmd = "cat", stdin = first.stdout
})
local output = second.stdout.read()
print(output) |
Awesome, great to see it being used 😄
Yep that's correct 👌 |
Ref:
plenary.job
.As title. It'd be awesome if it could be implemented without using callbacks.
EDIT: New API
Ref: #7
OLD
-- Just my random thoughts.
The text was updated successfully, but these errors were encountered: