[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/el-job 090be5b36d 017/143: fix
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/el-job 090be5b36d 017/143: fix |
Date: |
Fri, 21 Mar 2025 19:00:22 -0400 (EDT) |
branch: elpa/el-job
commit 090be5b36dfcfe010ef275a7f745e967d98a68e1
Author: Martin Edström <meedstrom91@gmail.com>
Commit: Martin Edström <meedstrom91@gmail.com>
fix
---
README.org | 4 +---
el-job.el | 71 +++++++++++++++++++++++++++++++-------------------------------
2 files changed, 36 insertions(+), 39 deletions(-)
diff --git a/README.org b/README.org
index cf9294319f..a6bdc62ec6 100644
--- a/README.org
+++ b/README.org
@@ -4,9 +4,7 @@ Imagine you have a function you'd like to run on a long list of
inputs. You cou
This library is a tool to split up the inputs and run the function in many
subprocesses (one per CPU core), then merge their outputs and pass it back to
the current Emacs. In the meantime, current Emacs does not hang at all.
--------
-
-For real-world usage, search for =el-job-launch= in the source of
[[https://github.com/meedstrom/org-node/blob/use-el-job/org-node.el][org-node.el]]
(unreleased feature branch---waiting on MELPA inclusion).
+For real-world usage, search for =el-job-launch= in the source of
[[https://github.com/meedstrom/org-node/blob/use-el-job/org-node.el][org-node.el]].
** News
diff --git a/el-job.el b/el-job.el
index 7ec2070c71..07e5bf3f94 100644
--- a/el-job.el
+++ b/el-job.el
@@ -52,8 +52,7 @@ At level 0, display as warning."
(declare (indent 2))
(if (<= level el-job--debug-level)
(if (> level 0)
- (message (concat (format "(el-job debug:%d) " level) fmt)
- args)
+ (apply #'message fmt args)
(display-warning 'el-job (apply #'format-message fmt args)))))
(defun el-job--find-lib (feature)
@@ -294,6 +293,7 @@ only the max interval between two polls.")
stderr
(timestamps (list :accept-launch-request (time-convert nil t)))
(poll-timer (timer-create))
+ (timeout (timer-create))
finish-times
(past-elapsed (make-hash-table :test #'equal))
spawn-args
@@ -591,42 +591,41 @@ should trigger `el-job--receive'."
( .ready .busy .input-sets .results .queue .cores .past-elapsed
.benchmark .timestamps .poll-timer .finish-times .anonymous .method
.id .timeout )
- (cancel-timer .timeout))
- (setf .results nil)
- (setf .finish-times nil)
- (let ((splits (el-job--split-optimally .queue .cores .past-elapsed)))
- (unless (length< splits (1+ (length .ready)))
- (error "Items split in %d lists, but only %d ready processes"
- (length splits) (length .ready)))
- (let ((print-length nil)
- (print-level nil)
- (print-circle t)
- (print-symbols-bare t)
- (print-escape-newlines t)
- items proc)
- (while splits
- (setq items (pop splits))
- (cl-assert .ready)
- (setq proc (pop .ready))
- (push proc .busy)
- (when .benchmark
- (setf (alist-get proc .input-sets) items))
- (with-current-buffer (process-buffer proc)
- (erase-buffer)
- (process-send-string proc (prin1-to-string items))
- (process-send-string proc "\n")
- (when (eq .method 'reap)
- (process-send-string proc "die\n"))))))
- (setf .queue nil)
- (plist-put .timestamps :launched (time-convert nil t))
- (setf .timeout (run-with-timer 30 nil #'el-job--timeout .id))
- (when (eq .method 'poll)
- (cancel-timer .poll-timer)
- (setf .poll-timer
- (run-with-timer 0.1 nil #'el-job--poll .busy .poll-timer 0.1))))
+ (cancel-timer .timeout)
+ (setf .results nil)
+ (setf .finish-times nil)
+ (let ((splits (el-job--split-optimally .queue .cores .past-elapsed)))
+ (unless (length< splits (1+ (length .ready)))
+ (error "Items split in %d lists, but only %d ready processes"
+ (length splits) (length .ready)))
+ (let ((print-length nil)
+ (print-level nil)
+ (print-circle t)
+ (print-symbols-bare t)
+ (print-escape-newlines t)
+ items proc)
+ (while splits
+ (setq items (pop splits))
+ (cl-assert .ready)
+ (setq proc (pop .ready))
+ (push proc .busy)
+ (when .benchmark
+ (setf (alist-get proc .input-sets) items))
+ (with-current-buffer (process-buffer proc)
+ (erase-buffer)
+ (process-send-string proc (prin1-to-string items))
+ (process-send-string proc "\n")
+ (when (eq .method 'reap)
+ (process-send-string proc "die\n"))))))
+ (setf .queue nil)
+ (plist-put .timestamps :launched (time-convert nil t))
+ (setf .timeout (run-with-timer 30 nil #'el-job--timeout .id))
+ (when (eq .method 'poll)
+ (cancel-timer .poll-timer)
+ (setf .poll-timer
+ (run-with-timer 0.1 nil #'el-job--poll .busy .poll-timer 0.1)))))
(defun el-job--timeout (id)
- "If PROC "
(let ((job (gethash id el-jobs)))
(if (and job (el-job:busy job))
(progn
- [nongnu] branch elpa/el-job created (now 0a70c578b5), ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 54a1e39f5c 003/143: ., ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job e290f1249c 007/143: ., ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job fbda86f637 002/143: ., ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 30cda35042 006/143: Satisfy linters, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 090be5b36d 017/143: fix,
ELPA Syncer <=
- [nongnu] elpa/el-job a5f9e72c17 018/143: Clean, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job c1d9aec762 021/143: Move code around, polish docstrings, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 9af473582e 024/143: Revert mistake (fix org-node issue #71), ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 612338ce61 029/143: Extra safety clause, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job e13a224d7e 040/143: Change default method when fast-read-process-output is nil, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 594dc70c09 037/143: Split function el-job--find-lib, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job d25d41bb56 063/143: Lump commit, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job d045f9a390 045/143: Switch most uses of time-convert to current-time, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 44ef7d1026 082/143: Revert "Release version 1.0.4", ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job b000549169 078/143: Readme, ELPA Syncer, 2025/03/21