Mercurial > libervia-pubsub
comparison idavoll/tap_http.py @ 204:b4bf0a5ce50d
Implement storage facilities for the HTTP gateway.
Author: ralphm.
Fixes #12.
One of the storage facilities is PostgreSQL based, providing persistence.
author | Ralph Meijer <ralphm@ik.nu> |
---|---|
date | Wed, 16 Jul 2008 06:38:32 +0000 |
parents | 9038908dc2f5 |
children | 274a45d2a5ab |
comparison
equal
deleted
inserted
replaced
203:2c46e6664680 | 204:b4bf0a5ce50d |
---|---|
34 bs = s.getServiceNamed('backend') | 34 bs = s.getServiceNamed('backend') |
35 cs = s.getServiceNamed('component') | 35 cs = s.getServiceNamed('component') |
36 | 36 |
37 # Set up XMPP service for subscribing to remote nodes | 37 # Set up XMPP service for subscribing to remote nodes |
38 | 38 |
39 ss = RemoteSubscriptionService(config['jid']) | 39 if config['backend'] == 'pgsql': |
40 from idavoll.pgsql_storage import GatewayStorage | |
41 gst = GatewayStorage(bs.storage.dbpool) | |
42 elif config['backend'] == 'memory': | |
43 from idavoll.memory_storage import GatewayStorage | |
44 gst = GatewayStorage() | |
45 | |
46 ss = RemoteSubscriptionService(config['jid'], gst) | |
40 ss.setHandlerParent(cs) | 47 ss.setHandlerParent(cs) |
41 ss.startService() | 48 ss.startService() |
42 | 49 |
43 # Set up web service | 50 # Set up web service |
44 | 51 |