From: Johan Andersson <johan.andersson@burtcorp.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 24849@debbugs.gnu.org
Subject: bug#24849: Is Emacs put in idle mode when window is not focused?
Date: Tue, 1 Nov 2016 20:48:59 +0100 [thread overview]
Message-ID: <CAF4YyTpFPvUsYwanf5+9VTTWbozYK+-NruN-xyyREhfZT1sGYA@mail.gmail.com> (raw)
In-Reply-To: <83oa1znpah.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2799 bytes --]
Sorry for not being clear enough.
With Prodigy, you define a service. Usually that is a path, command and
arguments to the command. You can then via the Prodigy GUI manage
(start/stop/restart/etc...) these services.
To put it very simple, what happens in Prodigy when a service is started is
basically this:
(let* ((default-directory "/tmp")
(process (start-process "server" nil "python" "-m"
"SimpleHTTPServer" "8000")))
(set-process-filter
process
(lambda (_ output)
;; ...
)))
What happens in practice is that, when I get to work, I select the services
I need and start them (unless Emacs was killed, they are already started).
Sometimes I use Emacs quite frequently and then this is not so much of an
issue because Emacs does not have time to idle. But when I don't use Emacs
for a while, it will hang waiting for the response from the service
(because Emacs is idle).
Hope you understand my issue better!
On Tue, Nov 1, 2016 at 5:22 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Johan Andersson <johan.andersson@burtcorp.com>
> > Date: Tue, 1 Nov 2016 09:44:20 +0100
> >
> > I have written an Emacs package called Prodigy (
> https://github.com/rejeep/prodigy.el/). The package is used
> > to manage external services from within Emacs. A service is some kind of
> running process, usually a web
> > server or database.
> >
> > There has always been an issue that I have not investigated further. It
> seems that after a while, if Emacs is
> > not focused, it ends up in some idle mode. The effect is that requests
> are very slow, almost hangs for a few
> > seconds. If I focus the Emacs window, the request goes through
> immediately.
> >
> > The reason I'm asking about it now is that this has gotten even worse in
> Emacs 25.
> >
> > My question is if anyone knows what this is about and if it's possible
> to solve?
>
> Please describe in more detail what you package does and how it is
> related to "non-idle" Emacs. IOW, why does your package care whether
> Emacs is idle or not.
>
> My suspicion is that your package somehow assumes that the Emacs main
> loop is always running at the same fast speed, which is not true. In
> particular, when the frame doesn't have the focus, Emacs 25 stops the
> blinking cursor timer, and if that is the only high-frequency activity
> in Emacs (i.e. there's no other timers or external events that drive
> the event loop), then yes, Emacs will only crank the event loop at
> very low frequency.
>
> But I'm not sure this is related to your problem, because I don't know
> what does your package expect from Emacs.
>
--
Johan Andersson
System Developer, Burt
www.burtcorp.com
Cell: +46 761 041607
https:// <http://twitter.com/rejeep>github.com/rejeep |
http://twitter.com/rejeep | http://twitter.com/burtcorp
[-- Attachment #2: Type: text/html, Size: 4507 bytes --]
next prev parent reply other threads:[~2016-11-01 19:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-01 8:44 bug#24849: Is Emacs put in idle mode when window is not focused? Johan Andersson
2016-11-01 16:22 ` Eli Zaretskii
2016-11-01 19:48 ` Johan Andersson [this message]
2016-11-01 20:13 ` Eli Zaretskii
2016-11-01 20:18 ` Johan Andersson
2016-11-01 20:28 ` Daniel Colascione
2016-11-01 20:33 ` Johan Andersson
2016-11-01 20:37 ` Daniel Colascione
2016-11-01 20:41 ` Johan Andersson
2016-11-01 20:44 ` Daniel Colascione
2016-11-01 20:51 ` Johan Andersson
2016-11-01 23:25 ` Alan Third
2016-11-02 8:00 ` Johan Andersson
2016-11-01 20:45 ` Eli Zaretskii
2016-11-01 20:52 ` Johan Andersson
2016-11-02 2:18 ` Richard Stallman
2016-11-02 8:10 ` Johan Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAF4YyTpFPvUsYwanf5+9VTTWbozYK+-NruN-xyyREhfZT1sGYA@mail.gmail.com \
--to=johan.andersson@burtcorp.com \
--cc=24849@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).