CK: more paranoia, idle status, and creation-time

William Jon McCann mccann at jhu.edu
Mon Feb 19 11:25:39 PST 2007


On 2/19/07, David Zeuthen <david at fubar.dk> wrote:
> On Mon, 2007-02-19 at 13:56 -0500, William Jon McCann wrote:
> > Perhaps we need to be a little more obvious about this.  Maybe we
> > should add the word "hint" in the property name or something like
> > that.  For example, instead of ck_session_set_idle
> > ck_session_set_idle_hint.
>
> That'd be nice. I was thinking it might be useful with a method
>
>  bool Manager.GetHintAllSessionsIdle()
>
> and a signal
>
>  Manager.HintAllSessionsIdleChanged (bool all_sessions_are_idle)
>
> Clearly if no sessions are available the method returns FALSE.

Sounds good.  In that case we should probably be consistent with the names, so:

bool Manager.GetAllSessionsIdleHint()
bool Session.GetIdleHint()
bool Session.SetIdleHint(bool)

   or

bool Manager.GetHintAllSessionsIdle()
bool Session.GetHintIdle()
bool Session.SetHintIdle(bool)

I think maybe the first is easier to read.

> I want to use this in HAL to change the polling frequency on removable
> drives from 2 secs to, say, 30 secs iff all sessions on the system are
> idle. Believe it or not, this thing comes up every time I'm at a
> conference so I'd like to fix it :-)

That'd be good.  One of the other use cases I had in mind was as a way
to improve anacron.  So that database re-indexing doesn't happen after
I've logged in (which drives me crazy).

> Of course, this is already possible today given the recent idle status
> stuff, but it requires hald-addon-storage, to track sessions, keep
> scores and in general do a lot of IPC that is not needed if you have the
> global interface. So I think this would be nice. I can write a patch
> (unless you beat me to it!) for this if you want. Thoughts?

Agreed.  Go for it :)

Thanks,
Jon


More information about the hal mailing list