1
# Copyright 2011 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
"""Long-poll infrastructure interfaces."""
10
from zope.interface import Attribute, Interface
13
class ILongPollEmitter(Interface):
16
"The key with which events will be emitted. Should be predictable "
20
class ILongPollSubscriber(Interface):
22
subscribe_key = Attribute(
23
"The key which the subscriber must know in order to be able "
24
"to long-poll for subscribed events. Should be infeasible to "
25
"guess, a UUID for example.")
27
def subscribe(emitter):
28
"""Subscribe to the given event emitter.
30
:type emitter: ILongPollEmitter