annotate idavoll.tac @ 229:f23fcdc19f7f

tac file sample
author Goffi <goffi@goffi.org>
date Thu, 10 May 2012 22:56:39 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
229
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/python
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
2 #-!- coding: utf-8 -!-
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
3 # Copyright (c) 2003-2008 Ralph Meijer
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # See LICENSE for details.
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
5
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
6 """
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
7 Example TAC for SàT Pubsub.
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
8 """
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
9
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
10 from twisted.application import service
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
11 from twisted.words.protocols.jabber.jid import JID
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
12
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
13 from idavoll import tap
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
14
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
15 application = service.Application("sat_pubsub")
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
16
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
17 config = {
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
18 'jid': JID('sat-pubsub.necton3.int'),
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
19 'secret': 'pass',
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
20 'rhost': '127.0.0.1',
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
21 'rport': 5347,
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
22 'backend': 'pgsql',
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
23 'dbuser': 'user',
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
24 'dbpass': 'pass',
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
25 'dbname': "pubsub",
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
26 'dbhost': "localhost",
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
27 'dbport': None,
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
28 'verbose': True,
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
29 'hide-nodes': False,
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
30 }
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
31
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
32 idavollService = tap.makeService(config)
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
33 idavollService.setServiceParent(application)
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
34
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
35 # Set the maximum delay until trying to reconnect.
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
36 componentService = idavollService.getServiceNamed('component')
f23fcdc19f7f tac file sample
Goffi <goffi@goffi.org>
parents:
diff changeset
37 componentService.factory.maxdelay = 300