Mercurial > libervia-pubsub
comparison sat_pubsub/backend.py @ 453:1a179ad10125
backend: service name can now be specified with `service_name` parameter
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 02 Jul 2021 15:39:57 +0200 |
parents | 8da3db1e82a9 |
children | 0b5233981671 |
comparison
equal
deleted
inserted
replaced
452:8da3db1e82a9 | 453:1a179ad10125 |
---|---|
1333 "subscribe", | 1333 "subscribe", |
1334 ] | 1334 ] |
1335 | 1335 |
1336 discoIdentity = disco.DiscoIdentity('pubsub', | 1336 discoIdentity = disco.DiscoIdentity('pubsub', |
1337 'service', | 1337 'service', |
1338 'Salut à Toi pubsub service') | 1338 const.SERVICE_NAME) |
1339 | 1339 |
1340 pubsubService = None | 1340 pubsubService = None |
1341 | 1341 |
1342 _errorMap = { | 1342 _errorMap = { |
1343 error.NodeNotFound: ('item-not-found', None, None), | 1343 error.NodeNotFound: ('item-not-found', None, None), |
1370 pubsub.PubSubResource.__init__(self) | 1370 pubsub.PubSubResource.__init__(self) |
1371 | 1371 |
1372 self.backend = backend | 1372 self.backend = backend |
1373 self.hideNodes = False | 1373 self.hideNodes = False |
1374 | 1374 |
1375 self.__class__.discoIdentity.name = backend.config["service_name"] | |
1376 | |
1375 self.backend.registerPublishNotifier(self._notifyPublish) | 1377 self.backend.registerPublishNotifier(self._notifyPublish) |
1376 self.backend.registerRetractNotifier(self._notifyRetract) | 1378 self.backend.registerRetractNotifier(self._notifyRetract) |
1377 self.backend.registerPreDelete(self._preDelete) | 1379 self.backend.registerPreDelete(self._preDelete) |
1378 | 1380 |
1379 if self.backend.supportsAutoCreate(): | 1381 if self.backend.supportsAutoCreate(): |