summaryrefslogtreecommitdiff
path: root/tumbler
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis@xfce.org>2011-02-13 23:07:47 +0100
committerJannis Pohlmann <jannis@xfce.org>2011-02-13 23:07:47 +0100
commitee0e466351457f1cc2e9856ec66c2f2fa798e363 (patch)
tree29a9e588134535d4104457f785d8a10a2a88d1c6 /tumbler
parentac10985250530ecc04daf91081737a9d3bc763db (diff)
downloadtumbler-ee0e466351457f1cc2e9856ec66c2f2fa798e363.tar.gz
Quit tumbler after five minutes of inactivity.
This is implemented via two new classes: TumblerLifecycleManager schedules a 300s timeout when tumblerd is started. When the timeout handler is executed, it emits a "shutdown" signal which is caught in main.c and asks the main loop to quit. The timeout is rescheduled whenever another component calls tumbler_lifecycle_manager_keep_alive() or when the timeout handler is called and one of the components is still busy processing requests from client applications. TumblerComponent is introduced as a new base class for the D-Bus service classes. Whenever a D-Bus method call is being processed, service objects increment the component use count by one and decrement it when the request is finished. They also call the keep alive method after a D-Bus method call is received to reschedule the timeout. A component use count of greather than 0 means that components are busy and the lifecycle manager needs to reschedule the shutdown timeout.
Diffstat (limited to 'tumbler')
-rw-r--r--tumbler/tumbler-error.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tumbler/tumbler-error.h b/tumbler/tumbler-error.h
index c6a1573..63e8424 100644
--- a/tumbler/tumbler-error.h
+++ b/tumbler/tumbler-error.h
@@ -1,6 +1,6 @@
/* vi:set et ai sw=2 sts=2 ts=2: */
/*-
- * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org>
+ * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -47,6 +47,7 @@ typedef enum /*< enum >*/
TUMBLER_ERROR_SAVE_FAILED,
TUMBLER_ERROR_UNSUPPORTED_FLAVOR,
TUMBLER_ERROR_NO_CONTENT,
+ TUMBLER_ERROR_SHUTTING_DOWN,
} TumblerErrorEnum;
G_END_DECLS