[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Feature Request] Hope Emacs can provide an async version of `url-co
From: |
Narendra Joshi |
Subject: |
Re: [Feature Request] Hope Emacs can provide an async version of `url-copy-file' |
Date: |
Thu, 09 Jul 2020 22:19:52 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
stardiviner <numbchild@gmail.com> writes:
> Because sometimes network is not good, so downloading might suspend Emacs for
> a
> long time. So I'm trying to implement an async downloading of `org-attach-url'
> in org-mode. But it require async version of `url-copy-file', write redundant
> code is not useful. Also I'm not able to implement that. So I send email for
> feature request here.
>
> Thanks in advance.
Would using threads work for your use case given that it's network
I/O. For example, this downloads a large file without blocking Emacs:
#+begin_src emacs-lisp
(make-thread (lambda () (url-copy-file "https://speed.hetzner.de/100MB.bin"
"/tmp/test.txt")))
#+end_src
Best,
--
Narendra Joshi