<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lightmon/config.py</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,5 +4,35 @@ Indeed, service checking classes are run on fixed time intervals as well as the
 reports back to the server.
 &quot;&quot;&quot;
 
+import sched
+import time
+
+from lightmon import config
+
+class Client(object):
+    &quot;&quot;&quot;
+    The main client class. Here we handle the time scheduled events
+    (included the lightmon process itself)
+    &quot;&quot;&quot;
+    def __init__(self):
+        # schedule the lightmon process as every ``SELF_CHECK_EVERY``
+        self.scheduler = sched.scheduler(time.time, time.sleep)
+        self.scheduler.enter(config.SELF_CHECK_EVERY, 1, self.controller, ())
+
+    def controller(self):
+        &quot;&quot;&quot;
+        Control if there are stale threads that needs to be killed
+        &quot;&quot;&quot;
+        print 'not yet: controller'
+        # reschedule ourselves every SELF_CHECK_EVERY seconds
+        self.scheduler.enter(config.SELF_CHECK_EVERY, 1, self.controller, ())
+
+    def run(self):
+        self.scheduler.run()
+
 def run():
-    print &quot;client&quot;
+    &quot;&quot;&quot;
+    Start the client timeline
+    &quot;&quot;&quot;
+    client = Client()
+    client.run()</diff>
      <filename>lightmon/client/runner.py</filename>
    </modified>
    <modified>
      <diff>@@ -45,7 +45,7 @@ def main(argv):
         usage(argv[0])
         return True
 
-    if not args:
+    if not opts:
         usage(argv[0])
         return True
 </diff>
      <filename>run.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>89a61ba97b2f1e6c524efd69bf607dcb0eed97dc</id>
    </parent>
  </parents>
  <author>
    <name>Ivan Giuliani</name>
    <email>giuliani.v@gmail.com</email>
  </author>
  <url>http://github.com/kratorius/lightmon/commit/f877f8e5b40f291264149a4ce049a9d9b078a3d0</url>
  <id>f877f8e5b40f291264149a4ce049a9d9b078a3d0</id>
  <committed-date>2009-11-03T11:27:07-08:00</committed-date>
  <authored-date>2009-11-03T11:27:07-08:00</authored-date>
  <message>Self check process is on the scheduler now</message>
  <tree>af15f32da6502569e306a2e9e868b86eb4c464eb</tree>
  <committer>
    <name>Ivan Giuliani</name>
    <email>giuliani.v@gmail.com</email>
  </committer>
</commit>
