|
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.
|