unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Async package.el
@ 2015-04-06 10:46 Artur Malabarba
  2015-04-06 13:53 ` Dmitry Gutov
  2015-04-07 18:06 ` Stefan Monnier
  0 siblings, 2 replies; 40+ messages in thread
From: Artur Malabarba @ 2015-04-06 10:46 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 2562 bytes --]

This is a heads up that I've pushed some commits that implement
asynchronicity in package.el. I'll explain implementation details below,
but I want to list the surface changes first.

- New variable `package-menu-async'. If this is non-nil the package menu
uses asynchronous operations when refreshing the archives and when
installing packages. For the purpose of testing on the devlist, I've set
the default to t. We can discuss whether we prefer this on or off when
Emacs gets released.

- For the sake of simplicity, when you hit `x' in the package-menu you will
no longer get two separate prompts for install/delete. You'll be prompted a
single time for everything.

- If you don't use the package-menu, nothing has changed on the surface.
That is, if you invoke `M-x package-install' or call this function with a
single argument everything will be synchronous. But the implementation is
there (determined by the function's 3rd and 4th args), so we could use the
prefix arg to specify async here.

Cheers to all,
Artur


-----
Implementation (for those who care)
-----

- Most functions which involve downloading data now take an extra optional
ASYNC argument (some of them also take an additional CALLBACK argument).
This defaults to nil. If it is t, any downloads involved are performed
asynchronously (and, if appropriate, CALLBACK is called afterwards).

- The only really async function (actually a macro) is
`package--with-work-buffer-async'. All other functions simply propagate
their ASYNC argument down to this one. If ASYNC nil, it just defers the
work back to `package--with-work-buffer'.

- Archives are refreshed all at the same time (which leads to a signficant
speed boost if you have several archives configured), so there's a new
variable `package--downloads-in-progress' to keep track of which archive
downloads are still ongoing. The function
`package--update-downloads-in-progress' takes care of controling this
variable and calling a relevant hook when it's all done.

- Package downloads are performed in sequence, because it is generally not
safe to do them in parallel (and deciding when/how it is safe is
complicated). So there's no variable to keep track of them.
`package-menu--perform-transaction' takes care to call `package-install' on
one package at a time (and possibly calls `package-delete' afterwards). In
turn, `package-install' takes care to install everything in the order
specified by `package-compute-transaction' (which ensures dependencies come
before the package itself). This is all done with recursive callbacks.

[-- Attachment #2: Type: text/html, Size: 2860 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2015-04-12  3:53 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-06 10:46 Async package.el Artur Malabarba
2015-04-06 13:53 ` Dmitry Gutov
2015-04-06 14:32   ` Artur Malabarba
2015-04-07  1:19     ` Dmitry Gutov
2015-04-07 21:46       ` Stefan Monnier
2015-04-08  1:49         ` Dmitry Gutov
2015-04-08 13:32           ` Stefan Monnier
2015-04-09  1:49             ` Dmitry Gutov
2015-04-09 14:06               ` raman
2015-04-09 14:22                 ` Rasmus
2015-04-09 14:50                   ` Artur Malabarba
2015-04-09 14:53                     ` Artur Malabarba
2015-04-09 15:19                   ` async message Ivan Shmakov
2015-04-10 14:58                     ` raman
2015-04-10  1:32                   ` Async package.el raman
2015-04-09 18:18                 ` Stefan Monnier
2015-04-10 15:00                   ` raman
2015-04-12  0:46                   ` Artur Malabarba
2015-04-12  3:53                     ` Stefan Monnier
2015-04-07 23:26       ` Artur Malabarba
2015-04-08  2:19         ` Dmitry Gutov
2015-04-08  9:43           ` Artur Malabarba
2015-04-08 16:02             ` Dmitry Gutov
2015-04-08 18:39               ` Artur Malabarba
2015-04-09  2:10                 ` Dmitry Gutov
2015-04-09 10:14                   ` Artur Malabarba
2015-04-09 12:34                     ` Dmitry Gutov
2015-04-12  1:38                       ` Artur Malabarba
2015-04-07  5:31     ` Daiki Ueno
2015-04-07  9:13       ` Dmitry Gutov
2015-04-07  9:59         ` Artur Malabarba
2015-04-07 11:22           ` Robert Pluim
2015-04-07 12:33             ` Artur Malabarba
2015-04-07 14:29               ` Robert Pluim
2015-04-08  2:21                 ` Artur Malabarba
2015-04-07 21:50           ` Stefan Monnier
2015-04-08  5:27           ` Daiki Ueno
2015-04-09  8:38           ` Achim Gratz
2015-04-09 13:09             ` Stefan Monnier
2015-04-07 18:06 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).