Skip to content

Small asynchronous process execution library for myself

Notifications You must be signed in to change notification settings

berquerant/emacs-little-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Little things async

Small asynchronous process execution library for myself.

Usage

# test.sh
#!/bin/bash
echo "to stderr" >&2
grep . -o | while read x ; do sleep 0.2 ; echo "$x" ; done
(little-async-start-process '("/path/to/test.sh")
                            :input "Hello!"
                            :filter (lambda (p output)
                                      (with-current-buffer
                                          (get-buffer-create "*tmp*")
                                        (insert (format "GOT %s" output))))
                            :stderr "*tmp-stderr*")

You will see below in *tmp* buffer:

GOT H
GOT e
GOT l
GOT l
GOT o
GOT !

Each line is written every 0.2 seconds. Meanwhile, Emacs will not be blocked.

You will see belo in *tmp-stderr* buffer:

to stderr

About

Small asynchronous process execution library for myself

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published