Add custom variables for worker and pipeline pause time
ci/woodpecker/push/woodpecker Pipeline failed Details

WIP-cache
Hugo Thunnissen 10 months ago
parent 5fe0b7bdc5
commit db3ec3b67d

@ -28,9 +28,20 @@
(define-error 'phpinspect-pipeline-incoming "Signal for incoming pipeline data") (define-error 'phpinspect-pipeline-incoming "Signal for incoming pipeline data")
(define-error 'phpinspect-pipeline-error "Signal for pipeline errors") (define-error 'phpinspect-pipeline-error "Signal for pipeline errors")
(defvar phpinspect-pipeline-pause-time 0.5 (defcustom phpinspect-pipeline-pause-time 0.5
"Number of seconds to pause a pipeline thread when emacs receives "Number of seconds to pause a pipeline thread when emacs receives
user input.") user input. This is similar to `phpinspect-worker-pause-time',
but pipelines are meant to run in bursts. For that reason, the
default pause time for pipelines is lower to be a little more
aggressive in hogging cpu time.
Set this variable to a higher value if you experience a lot of
jitter when editing during pipeline operations. At the time of
writing, pipelines are used to refresh the project
index/autoloader and for the indexation of \"include\"
directories."
:type 'number
:group 'phpinspect)
(cl-defstruct (phpinspect-pipeline-end (:constructor phpinspect-make-pipeline-end)) (cl-defstruct (phpinspect-pipeline-end (:constructor phpinspect-make-pipeline-end))
(value nil (value nil

@ -31,6 +31,14 @@
(require 'phpinspect-queue) (require 'phpinspect-queue)
(require 'phpinspect-pipeline) (require 'phpinspect-pipeline)
(defcustom phpinspect-worker-pause-time 1
"Number of seconds that `phpinspect-worker' should pause when
user input is detected. A higher value means better
responsiveness, at the cost of slower code indexation. On modern
hardware this probably doesn't need to be tweaked."
:type 'number
:group 'phpinspect)
(defvar phpinspect-worker nil (defvar phpinspect-worker nil
"Contains the phpinspect worker that is used by all projects.") "Contains the phpinspect worker that is used by all projects.")
@ -142,7 +150,7 @@ already present in the queue."
;; interrupt the thread. ;; interrupt the thread.
(unless (or (not (input-pending-p)) (unless (or (not (input-pending-p))
(phpinspect-worker-skip-next-pause worker)) (phpinspect-worker-skip-next-pause worker))
(phpinspect-thread-pause 1 mx continue)) (phpinspect-thread-pause phpinspect-worker-pauseo-time mx continue))
(setf (phpinspect-worker-skip-next-pause worker) nil))) (setf (phpinspect-worker-skip-next-pause worker) nil)))
(t (message "Phpinspect worker thread errored :%s" err)))) (t (message "Phpinspect worker thread errored :%s" err))))
(phpinspect--log "Worker thread exiting") (phpinspect--log "Worker thread exiting")

@ -142,6 +142,8 @@ Reparses the entire buffer without token reuse."
"A minor mode for intelligent completion for and interaction "A minor mode for intelligent completion for and interaction
with PHP files. with PHP files.
See also: \\[customize-group] RET phpinspect RET .
To initially index a project, use M-x `phpinspect-index-current-project' To initially index a project, use M-x `phpinspect-index-current-project'
in a buffer of one of the project files. Project root is detected with in a buffer of one of the project files. Project root is detected with
`phpinspect-project-root-file-list'. `phpinspect-project-root-file-list'.

Loading…
Cancel
Save