Coverage for services/pusher.py: 78%
7 statements
« prev ^ index » next coverage.py v6.4.4, created at 2024-04-19 09:45 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2024-04-19 09:45 -0600
1from django.conf import settings
2from pusher import Pusher
5class PusherClient:
6 """
7 Client for Pusher WebSockets
8 """
10 def __init__(self):
11 self.client = Pusher(
12 app_id=settings.PUSHER_APP_ID,
13 key=settings.PUSHER_KEY,
14 secret=settings.PUSHER_SECRET,
15 cluster="us2",
16 ssl=True,
17 )
19 def trigger(self, channel, event, data):
20 """
21 Trigger pusher event
22 """
23 self.client.trigger(channel, event, data)