Skip to content
This repository has been archived by the owner on Nov 23, 2020. It is now read-only.

Commit

Permalink
no fire events in channels
Browse files Browse the repository at this point in the history
  • Loading branch information
lsbardel committed Oct 23, 2016
1 parent 4d35988 commit f24a5c6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pulsar/apps/data/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ def __call__(self, channel_name, message):
if channel:
channel(message)

def lock(self, name, **kwargs):
"""Global distributed lock
"""
return self.pubsub.store.client().lock(self.prefixed(name), **kwargs)

async def connect(self, next_time=None):
if self.status in can_connect:
loop = self._loop
Expand Down Expand Up @@ -170,8 +175,7 @@ def create_channel(self, name):

def _connection_lost(self, *args):
self.status = StatusType.disconnected
self.fire_event('connection_lost')
self.connect()
self._loop.create_task(self.connect())

async def _connect(self, next_time):
try:
Expand Down

0 comments on commit f24a5c6

Please sign in to comment.