forked from progrium/ginkgo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNOTES
More file actions
93 lines (70 loc) · 2.09 KB
/
Copy pathNOTES
File metadata and controls
93 lines (70 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Gevent Tools solves:
- Daemonization
- Componentization
- Configuration
- Logging harness
====
====
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
=====
Trac Style Option definitions for configuration:
class MyClass():
foo = Option('category', 'name', 'default', etc)
This allows for localized access to configuration with defaults without
a global config object that is defined before services are instantiated.
This allows configuration to be used for declarative class things.
---
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(MyInterface)
class SomeExtension(Service):
implements(MyInterface)
def something(self):
pass
Manual extension addition
Automatic extension addition (extending services from config)
singleton services? common service instance interface?
self.s = Service('MySubService')
self.add_child(self.s)
---
zmq type detection works with rpc style. PUSH
--
Services as state machines
- initialized do_init
- started do_start
- ready
- stopped do_stop
--
TopLevelService / ServiceSingleton
-anything else
-(APPLICATION)
class MyService(Service):
netconfig = ServiceSingleton(NetConfig)
name = Option('name', 'blah', 'foo')
def __init__(self):
self.boxconfig = NetConfig(driver='boxconfig')
self.add_service(self.boxconfig)
==
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)