Skip to content

Commit

Permalink
Added function prototype for BaseChannelLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
jophy-ye committed Aug 10, 2024
1 parent e533186 commit 5456273
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions channels/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,31 @@ def non_local_name(self, name):
else:
return name

async def send(self, channel, message):
raise NotImplementedError("send() should be implemented in channels")

async def receive(self, channel):
raise NotImplementedError("receive() should be implemented in channels")

async def new_channel(self):
raise NotImplementedError("new_channel() should be implemented in channels")

# flush extension

async def flush(self):
raise NotImplementedError("flush() called but not implemented (flush extension)")

# groups extension

async def group_add(self, group, channel):
raise NotImplementedError("group_add() not implemented (groups extension)")

async def group_discard(self, group, channel):
raise NotImplementedError("group_discard() not implemented (groups extension)")

async def group_send(self, group, message):
raise NotImplementedError("group_send() not implemented (groups extension)")


class InMemoryChannelLayer(BaseChannelLayer):
"""
Expand Down

0 comments on commit 5456273

Please sign in to comment.