Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

"""Subclasses of :class:`comet.protocol.VOEventSubscriber` and 

:class:`comet.protocol.VOEventSubscriberFactory` that allow inspection of the 

list of active subscribers. 

""" 

from comet.protocol.subscriber import ( 

VOEventSubscriber as _VOEventSubscriber, 

VOEventSubscriberFactory as _VOEventSubscriberFactory) 

 

 

class VOEventSubscriber(_VOEventSubscriber): 

 

def connectionMade(self, *args): # noqa: N802 

self.factory.subscribers.append(self) 

super().connectionMade(*args) 

 

def connectionLost(self, *args): # noqa: N802 

self.factory.subscribers.remove(self) 

return super().connectionLost(*args) 

 

 

class VOEventSubscriberFactory(_VOEventSubscriberFactory): 

 

protocol = VOEventSubscriber 

 

def __init__(self, *args, **kwargs): 

super().__init__(*args, **kwargs) 

self.subscribers = []