* url-queue.el: New file.
(url-queue-run-queue): Pick the first waiting job, and not the
last.
+ (url-queue-parallel-processes): Lower the concurrency level, since
+ Emacs doesn't seem to like too many async processes.
+ (url-queue-prune-old-entries): Fix up the pruning code.
2011-04-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
(eval-when-compile (require 'cl))
(require 'browse-url)
-(defcustom url-queue-parallel-processes 4
+(defcustom url-queue-parallel-processes 2
"The number of concurrent processes."
:type 'integer
:group 'url)
(defstruct url-queue
url callback cbargs silentp
- process start-time)
+ buffer start-time)
+;;;###autoload
(defun url-queue-retrieve (url callback &optional cbargs silent)
"Retrieve URL asynchronously and call CALLBACK with CBARGS when finished.
Like `url-retrieve' (which see for details of the arguments), but
(apply (url-queue-callback job) (cons status (url-queue-cbargs job))))
(defun url-queue-start-retrieve (job)
- (setf (url-queue-process job)
+ (setf (url-queue-buffer job)
(ignore-errors
(url-retrieve (url-queue-url job)
#'url-queue-callback-function (list job)
url-queue-timeout))
(push job dead-jobs)))
(dolist (job dead-jobs)
- (when (processp (url-queue-process job))
+ (when (bufferp (url-queue-buffer job))
(ignore-errors
- (delete-process (url-queue-process job)))
+ (delete-process (get-buffer-process (url-queue-buffer job))))
(ignore-errors
- (kill-buffer (process-buffer (url-queue-process job))))
- (setq url-queue (delq job url-queue))))))
+ (kill-buffer (url-queue-buffer job))))
+ (setq url-queue (delq job url-queue)))))
(provide 'url-queue)