view doc/examples/idavoll.tac @ 222:698af5d720ad

Reshape Idavoll as a PubSubResource. PubSubResource is Wokkel's newer interface for building (parts of) XMPP publish-subscribe services and replaces the old interface of PubSubService. It is more flexible for adding new protocol, allows for node-as-code (providing a specific backend per node), and permits accepting requests for different entities (virtual hosts or PEP-like settings). This moves over the current backend to use the new interface, so new code for previously unsupported protocol can be added down the line.
author Ralph Meijer <ralphm@ik.nu>
date Sat, 16 Oct 2010 21:03:38 +0200
parents 5974e718f395
children 51af2ed8bd50
line wrap: on
line source

# Copyright (c) 2003-2008 Ralph Meijer
# See LICENSE for details.

"""
Example TAC for Idavoll.
"""

from twisted.application import service
from twisted.words.protocols.jabber.jid import JID

from idavoll import tap

application = service.Application("Idavoll")

config = {
    'jid': JID('pubsub.example.org'),
    'secret': 'secret',
    'rhost': '127.0.0.1',
    'rport': 5347,
    'backend': 'memory',
    'verbose': True,
    'hide-nodes': False,
}

idavollService = tap.makeService(config)
idavollService.setServiceParent(application)

# Set the maximum delay until trying to reconnect.
componentService = idavollService.getServiceNamed('component')
componentService.factory.maxdelay = 300