equal
deleted
inserted
replaced
118 session.execute('DELETE X %s Y WHERE Y eid %%(y)s, ' |
118 session.execute('DELETE X %s Y WHERE Y eid %%(y)s, ' |
119 'NOT X eid %%(x)s' % rtype, |
119 'NOT X eid %%(x)s' % rtype, |
120 {'x': eidfrom, 'y': eidto}) |
120 {'x': eidfrom, 'y': eidto}) |
121 |
121 |
122 |
122 |
|
123 class NullEventBus(object): |
|
124 def send(self, msg): |
|
125 pass |
|
126 |
|
127 def add_subscription(self, topic, callback): |
|
128 pass |
|
129 |
|
130 def start(self): |
|
131 pass |
|
132 |
|
133 def stop(self): |
|
134 pass |
|
135 |
|
136 |
123 class Repository(object): |
137 class Repository(object): |
124 """a repository provides access to a set of persistent storages for |
138 """a repository provides access to a set of persistent storages for |
125 entities and relations |
139 entities and relations |
126 |
140 |
127 XXX protect pyro access |
141 XXX protect pyro access |
132 if vreg is None: |
146 if vreg is None: |
133 vreg = cwvreg.CWRegistryStore(config) |
147 vreg = cwvreg.CWRegistryStore(config) |
134 self.vreg = vreg |
148 self.vreg = vreg |
135 self.pyro_registered = False |
149 self.pyro_registered = False |
136 self.pyro_uri = None |
150 self.pyro_uri = None |
|
151 self.app_instances_bus = NullEventBus() |
137 self.info('starting repository from %s', self.config.apphome) |
152 self.info('starting repository from %s', self.config.apphome) |
138 # dictionary of opened sessions |
153 # dictionary of opened sessions |
139 self._sessions = {} |
154 self._sessions = {} |
140 # list of functions to be called at regular interval |
155 # list of functions to be called at regular interval |
141 self._looping_tasks = [] |
156 self._looping_tasks = [] |