~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/longpoll/adapters/event.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-09-24 09:11:33 UTC
  • mfrom: (14002.1.27 longpoll-dead-rabbit)
  • Revision ID: launchpad@pqm.canonical.com-20110924091133-9ckf4ojh50fs57si
[r=sinzui][no-qa] Make it possible for message queue using code to
 continue to work even if the queue is unavailable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
    "LongPollEvent",
10
10
    ]
11
11
 
12
 
from lp.services.messaging.queue import RabbitRoutingKey
13
 
 
14
 
 
15
 
router_factory = RabbitRoutingKey
 
12
from zope.component import getUtility
 
13
 
 
14
from lp.services.messaging.interfaces import IMessageSession
 
15
 
 
16
 
 
17
def router_factory(event_key):
 
18
    """Get a router for the given `event_key`."""
 
19
    return getUtility(IMessageSession).getProducer(event_key)
16
20
 
17
21
 
18
22
def generate_event_key(*components):