all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Running processing functions in background
@ 2020-11-19 11:53 Jean Louis
  2020-11-22 14:06 ` Michael Heerdegen
  0 siblings, 1 reply; 5+ messages in thread
From: Jean Louis @ 2020-11-19 11:53 UTC (permalink / raw)
  To: Help GNU Emacs

I have some functions that are blocking Emacs interface
while they are processing database in background. Functions
are not interactive. Output goes to dedicated buffer for
later human review. And I prefer not to use external async
package.

I would like to have responsive Emacs while running and the
background function I think to intertwine with
`run-with-idle-timer' as function is sending emails to the
mailing list and there is no rush in doing so.

The `make-thread' did work well but interface remain not so
responsive, it slows down.

Is there some other approach when using only Emacs built-in
functions?




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Running processing functions in background
  2020-11-19 11:53 Running processing functions in background Jean Louis
@ 2020-11-22 14:06 ` Michael Heerdegen
  2020-11-22 14:23   ` Jean Louis
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Michael Heerdegen @ 2020-11-22 14:06 UTC (permalink / raw)
  To: Jean Louis; +Cc: Help GNU Emacs

Jean Louis <bugs@gnu.support> writes:

> I have some functions that are blocking Emacs interface
> while they are processing database in background. Functions
> are not interactive. Output goes to dedicated buffer for
> later human review. And I prefer not to use external async
> package.
>
> I would like to have responsive Emacs while running and the
> background function I think to intertwine with
> `run-with-idle-timer' as function is sending emails to the
> mailing list and there is no rush in doing so.
>
> The `make-thread' did work well but interface remain not so
> responsive, it slows down.

Is that work a bug report?  Why does that happen?

> Is there some other approach when using only Emacs built-in
> functions?

The only alternative I know are generators and streams; they can be used
together with `while-no-input' or `throw-on-input' to implement
interruptable calculations if you write your program in an appropriate
style, but in my experience it is quite a fiddle.

emacs-async is not so bad if it's suitable for ones use case.

Michael.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Running processing functions in background
  2020-11-22 14:06 ` Michael Heerdegen
@ 2020-11-22 14:23   ` Jean Louis
  2020-11-25 14:20   ` Michael Heerdegen
  2020-12-03  9:08   ` Jean Louis
  2 siblings, 0 replies; 5+ messages in thread
From: Jean Louis @ 2020-11-22 14:23 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Help GNU Emacs

* Michael Heerdegen <michael_heerdegen@web.de> [2020-11-22 17:07]:
> Jean Louis <bugs@gnu.support> writes:
> 
> > I have some functions that are blocking Emacs interface
> > while they are processing database in background. Functions
> > are not interactive. Output goes to dedicated buffer for
> > later human review. And I prefer not to use external async
> > package.
> >
> > I would like to have responsive Emacs while running and the
> > background function I think to intertwine with
> > `run-with-idle-timer' as function is sending emails to the
> > mailing list and there is no rush in doing so.
> >
> > The `make-thread' did work well but interface remain not so
> > responsive, it slows down.
> 
> Is that work a bug report?  Why does that happen?
> 
> > Is there some other approach when using only Emacs built-in
> > functions?
> 
> The only alternative I know are generators and streams; they can be used
> together with `while-no-input' or `throw-on-input' to implement
> interruptable calculations if you write your program in an appropriate
> style, but in my experience it is quite a fiddle.
> 
> emacs-async is not so bad if it's suitable for ones use case.

Thank you for references.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Running processing functions in background
  2020-11-22 14:06 ` Michael Heerdegen
  2020-11-22 14:23   ` Jean Louis
@ 2020-11-25 14:20   ` Michael Heerdegen
  2020-12-03  9:08   ` Jean Louis
  2 siblings, 0 replies; 5+ messages in thread
From: Michael Heerdegen @ 2020-11-25 14:20 UTC (permalink / raw)
  To: Jean Louis; +Cc: Help GNU Emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> > The `make-thread' did work well but interface remain not so
> > responsive, it slows down.
>
> Is that work a bug report?  Why does that happen?
          ^^^^

I meant to ask "Is that worth a bug report?".  Sorry for the
typo.

Regards,

Michael.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Running processing functions in background
  2020-11-22 14:06 ` Michael Heerdegen
  2020-11-22 14:23   ` Jean Louis
  2020-11-25 14:20   ` Michael Heerdegen
@ 2020-12-03  9:08   ` Jean Louis
  2 siblings, 0 replies; 5+ messages in thread
From: Jean Louis @ 2020-12-03  9:08 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Help GNU Emacs

* Michael Heerdegen <michael_heerdegen@web.de> [2020-11-22 17:07]:
> Jean Louis <bugs@gnu.support> writes:
> 
> > I have some functions that are blocking Emacs interface
> > while they are processing database in background. Functions
> > are not interactive. Output goes to dedicated buffer for
> > later human review. And I prefer not to use external async
> > package.
> >
> > I would like to have responsive Emacs while running and the
> > background function I think to intertwine with
> > `run-with-idle-timer' as function is sending emails to the
> > mailing list and there is no rush in doing so.
> >
> > The `make-thread' did work well but interface remain not so
> > responsive, it slows down.
> 
> Is that work a bug report?  Why does that happen?
> 
> > Is there some other approach when using only Emacs built-in
> > functions?
> 
> The only alternative I know are generators and streams; they can be used
> together with `while-no-input' or `throw-on-input' to implement
> interruptable calculations if you write your program in an appropriate
> style, but in my experience it is quite a fiddle.
> 
> emacs-async is not so bad if it's suitable for ones use case.

Thank you for that.

I could make something so that mailing list is sent from Emacs with
(run-with-idle-timer SECS REPEAT FUNCTION &rest ARGS) and that not
many emails are sent, for example 5 instead 500 at once.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-03  9:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-19 11:53 Running processing functions in background Jean Louis
2020-11-22 14:06 ` Michael Heerdegen
2020-11-22 14:23   ` Jean Louis
2020-11-25 14:20   ` Michael Heerdegen
2020-12-03  9:08   ` Jean Louis

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.