Make asynchronous and possibility to stop the HTTP request
HI !
It could be cool to make this plugin asynchronous? Actually, if the remote server take long time to deliver a response, Vim is totally blocked.
To test it, simply on your Server, create a REST endpoint and add delay before send the HTTP response.
Neovim and Vim since version 8.0 support asynchronous plugins.
If the plugin become asynchronous, maybe it could be easy killed thanks a command? As it if we want interrupt the HTTP Request, we could.
Thanks in advance ;-)
Running requests shouldn't be freezing ViM with the current version. Although I think it still freezes Neovim, but I haven't invested much time there just yet. Let me know how it goes with ViM.
Yes, does not freeze Vim in the current version, so cool :-).
For the other question, maybe it could be hard to manage HTTP request sent (cancel a request sent). It's very easy with https://github.com/diepm/vim-rest-console , by simply kill the corresponding childd curl process. But roast.vim doesn't seems to launch an independent child process.
$ ps -u julioprayer --forest
PID TTY TIME CMD
[…]
11082 pts/4 00:00:00 \_ zsh
11313 pts/4 00:00:00 \_ vim
[…]
As you say it still freezes Neovim, but with Neovim there are also others problems (see https://github.com/sharat87/roast.vim/issues/8 ).
I'm sad, seems not to be possible to stop it https://stackoverflow.com/questions/13809336/how-can-i-cancel-an-in-flight-requests-session-get-request