[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/el-job 6323ebbb67 014/143: Separate child init from accept
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/el-job 6323ebbb67 014/143: Separate child init from accepting input |
Date: |
Fri, 21 Mar 2025 19:00:22 -0400 (EDT) |
branch: elpa/el-job
commit 6323ebbb6727f7b8611e210d08cbe3edf9772d8d
Author: Martin Edström <meedstrom91@gmail.com>
Commit: Martin Edström <meedstrom91@gmail.com>
Separate child init from accepting input
---
el-job-child.el | 41 +++++++++++++++++++++++------------------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/el-job-child.el b/el-job-child.el
index e21234ea6e..55a78fb2b2 100644
--- a/el-job-child.el
+++ b/el-job-child.el
@@ -1,4 +1,4 @@
-;;; el-job-child.el --- -*- lexical-binding: t; -*-
+;;; el-job-child.el --- Worker code for children -*- lexical-binding: t; -*-
;; Copyright (C) 2024 Martin Edström
;; This program is free software: you can redistribute it and/or modify
@@ -16,12 +16,15 @@
;;; Commentary:
-;; We use `time-convert' instead of `current-time' because
-;; 1. (TICKS . HZ) implies a bit less GC churn than (HIGH LOW USEC PSEC)
-;; 2. With `current-time', we would have to inject `current-time-list'
+;; The part of the codebase that child processes will need, and no more.
;;; Code:
+;; We use `time-convert' instead of `current-time' because
+;; 1. (TICKS . HZ) implies a bit less GC churn than (HIGH LOW USEC PSEC)
+;; 2. (TICKS . HZ) will be future default
+;; 3. With `current-time', we would have to always inject `current-time-list'
+
(defun el-job-child--zip (alist1 alist2)
"Zip two alists into one, destructively.
Like the Dash expression \(-zip-with #\\='nconc list1 list2).
@@ -35,28 +38,29 @@ and each element must be a proper list or nil."
(when alist2 (error "Lists differed in length"))
(nreverse merged)))
-;; (defun el-job-child--receive-injection ()
-;; ;; (dolist (var (read-minibuffer ""))
-;; (dolist (var (read t))
-;; (set (car var) (cdr var))))
+(defun el-job-child--receive-injection ()
+ "Handle :inject-vars, :load and :eval-once."
+ (let ((vars (read-minibuffer ""))
+ (libs (read-minibuffer ""))
+ (eval (read-minibuffer "")))
+ (dolist (var vars)
+ (set (car var) (cdr var)))
+ (dolist (lib libs)
+ (load lib))
+ (if eval (eval eval))))
+(defvar el-job-child--ready nil)
(defun el-job-child--work (func)
"Run FUNC on one of ITEMS at a time.
FUNC comes from :funcall argument of `org-node-job-launch'.
Benchmark how long FUNC took to handle each item, and add that
information to the final return value."
- ;; (let ((items (read-minibuffer ""))
- (let ((vars (read-minibuffer ""))
- (libs (read-minibuffer ""))
- (eval (read-minibuffer ""))
- (items (read-minibuffer ""))
+ (unless el-job-child--ready
+ (setq el-job-child--ready t)
+ (el-job-child--receive-injection))
+ (let ((items (read-minibuffer ""))
item start output meta results)
- (dolist (var vars)
- (set (car var) (cdr var)))
- (dolist (lib libs)
- (load lib))
- (if eval (eval eval))
(if items
(while items
(setq item (pop items))
@@ -74,6 +78,7 @@ information to the final return value."
(let (print-length
print-level
(print-circle t)
+ (print-escape-newlines t)
(print-symbols-bare t))
(prin1 (cons meta results)))))
- [nongnu] elpa/el-job 3a042190a0 068/143: Internal rename, (continued)
- [nongnu] elpa/el-job 3a042190a0 068/143: Internal rename, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job edb0a16b71 046/143: Remove :eval-once, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 0b180cc276 112/143: Comments, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job bbaf49fa17 056/143: Turn an error into polite debug message, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 70bdb8fea5 055/143: Polish, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job ad229ec4ba 110/143: CI, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 96c1d0bf4f 119/143: Safer let-binding inside while-loop, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job bbf11134fb 060/143: Merge branch 'dev', ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 2b52e884cc 117/143: Lint, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 01b330043c 010/143: ., ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 6323ebbb67 014/143: Separate child init from accepting input,
ELPA Syncer <=
- [nongnu] elpa/el-job 40f86f79fc 028/143: Clarifications, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 15b821ebb2 086/143: Don't handle deprecated usage, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 3d59e81d41 094/143: Polish, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job a70b492bf4 105/143: Release version 2.1.0, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 73835a02a0 103/143: Try to be compatible with Emacs 28, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job ca15123593 064/143: Readme, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 349761d380 120/143: Add checkdoc to CI, without ispell, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job d501872523 118/143: Lint, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 6f93dc82bd 121/143: Add obsolete internal alias to ease upgrade-in-running-Emacs, ELPA Syncer, 2025/03/21
- [nongnu] elpa/el-job 27cf46baf0 123/143: Hotfix, ELPA Syncer, 2025/03/21