Skip to content

async_job not starting job #33

@Kronuz

Description

@Kronuz

I've been using zsh-async on a theme (based on zprezto's sorin prompt) but I've frequently noticed async stops working.

I only initialize the worker once, during precmd:

  # Initialize async worker. This needs to be done here and not in
  # prompt_kronuz_setup so the git formatting can be overridden by other prompts.
  if (( !${prompt_kronuz_async_init:-0} )); then
    async_start_worker "prompt_kronuz" -n
    async_register_callback "prompt_kronuz" prompt_kronuz_async_callback
    typeset -g prompt_kronuz_async_init=1
  fi

  # Kill the old process of slow commands if it is still running.
  async_flush_jobs "prompt_kronuz"

  # Compute slow commands in the background.
  async_job "prompt_kronuz" prompt_kronuz_async_git "$PWD"

Not knowing why, I added some logging and I'm now seeing async_job is being called, but the job function (prompt_kronuz_async_git) is not... as if the worker had died?

Is there a way I could list active workers? ...or how can I know if worker died? ...and why?

Edit:
If I call zpty, I see this: (finished) prompt_kronuz: _async_worker -p 89022 -n... which sure enough shows the async worker as finished. Is there a way to know why, or if it's finished automatically restart it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions