[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: async export and then do something with file
From: |
Tim Cross |
Subject: |
Re: async export and then do something with file |
Date: |
Fri, 30 Apr 2021 15:36:49 +1000 |
User-agent: |
mu4e 1.5.12; emacs 28.0.50 |
Matt Price <moptop99@gmail.com> writes:
> Hi everyone,
>
> I am wondering if I can perform and export asynchronously and then, without
> tying up emacs, wait around for the export to finish and then perform
> some other task, like upload the file to a server. Has anyone tried this
> before? I think perhaps the easiest thing to do would be to use async.el or
> some similar third-party, but I can't tell what the preferred method is. I
> would love osme guidance!
>
The asynchronous export should be possible and I've seen some proposed
patches for this discussed recently. The challenge is your second part. In
other languages,
you could use something like a 'future' (Clojure) or a Promise
(Javascript), but I'm not 100% sure with Elisp. I suspect you would need
to create the async process and use the :sentinal option to pass in a
process sentinal function, which is essentially a function that will run
whenever the status of a process changes. The sentinal would need to
watch for a status change which indicates the process has finished and
then call whatever your post-export actions are.
HTH
Tim
--
Tim Cross