
Gevent Tools solves:
 - Daemonization
 - Componentization
 - Configuration
 - Logging harness

os.stat(filename).st_mtime

====
====

s = ZMQClient('this.service')

class SomeService(ZMQService('this.service')):
    implements = ('OtherService:Interface')
    menu_providers = ExtensionPoint()
    
    @extends('OtherService', 'menu_providers')
    def get_menus(self):
        pass
    
    def push(self, blah):
        pass

prefix/this.service => REP
        /host1
        /host2
---
Article progression:
 - Services
 - Runner
 - Extensions?
 - Distributed Services
---

Service uses extension points to allow distributed services?

class MyInterface(Interface):
    def something(self):
        pass

class SomeService(Service):
    observers = ExtensionPoint('observers')

class SomeExtension(Service):
    observer = Extension('SomeService:observers')
    
    @observer
    def something(self):
        pass
        
===
class SomeService(Service):
    menu_providers = ExtensionPoint()
    
    def do_start(self):
        for provider in self.menu_providers:
            print provider.menu_items()

class AnotherService(Service):
    menu_provider = Extends('SomeService.menu_providers')
    
    @menu_provider
    def menu_items(self):
        return ['ab', 'bc']

class OneMoreService(Service):
    provider = Extends('SomeService.menu_providers')
    
    @provider('menu_items')
    def get_items_for_menu(self):
        return ['123', '456', '678']


===

Manual extension addition
Automatic extension addition (extending services from config)


---
zmq type detection works with rpc style. PUSH

--
Services as state machines
 - initialized  do_init
 - started  do_start
 - ready
 - stopped  do_stop
==
extensions assume singleton components implementing extension points
the pubsub/gateway example relies on the pubsub extension point to reach the exact service instance
    that extended it (ie, if cluster service, multiple instances would be load balanced across)
