Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added function prototype for BaseChannelLayer #2112

Merged
merged 4 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions channels/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,29 @@ def non_local_name(self, name):
else:
return name

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

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

async def new_channel(self):
raise NotImplementedError(
"new_channel() should be implemented in a channel layer"
)

async def flush(self):
raise NotImplementedError("flush() not implemented (flush 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
Loading