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

Bump channels to 3.0.4 #1926

Merged
merged 1 commit into from
Apr 16, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion config/requirements_core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ psycopg2==2.9.2 # For Django to talk to postgres

# Channels
asgiref==3.3.4 # Must set version to avoid Channels bug #1713
channels==2.4.0 # Channels; also includes the Daphne server
channels==3.0.4 # Channels; also includes the Daphne server
channels_redis==3.2.0 # Channels Layer

# Misc
Expand Down
22 changes: 12 additions & 10 deletions tabbycat/routing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from channels.auth import AuthMiddlewareStack
from channels.routing import ChannelNameRouter, ProtocolTypeRouter, URLRouter
from django.conf.urls import url
from django.core.asgi import get_asgi_application

from actionlog.consumers import ActionLogEntryConsumer
from adjallocation.consumers import AdjudicatorAllocationWorkerConsumer, PanelEditConsumer
Expand All @@ -17,28 +18,29 @@

application = ProtocolTypeRouter({

# HTTP handled automatically
# HTTP handler
"http": get_asgi_application(),

# WebSocket handlers
"websocket": AuthMiddlewareStack(
URLRouter([
# TournamentOverviewContainer
url(r'^ws/(?P<tournament_slug>[-\w_]+)/action_logs/$', ActionLogEntryConsumer),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/ballot_results/$', BallotResultConsumer),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/ballot_statuses/$', BallotStatusConsumer),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/action_logs/$', ActionLogEntryConsumer.as_asgi()),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/ballot_results/$', BallotResultConsumer.as_asgi()),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/ballot_statuses/$', BallotStatusConsumer.as_asgi()),
# CheckInStatusContainer
url(r'^ws/(?P<tournament_slug>[-\w_]+)/checkins/$', CheckInEventConsumer),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/checkins/$', CheckInEventConsumer.as_asgi()),
# Draw and Preformed Panel Edits
url(r'^ws/(?P<tournament_slug>[-\w_]+)/round/(?P<round_seq>[-\w_]+)/debates/$', DebateEditConsumer),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/round/(?P<round_seq>[-\w_]+)/panels/$', PanelEditConsumer),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/round/(?P<round_seq>[-\w_]+)/debates/$', DebateEditConsumer.as_asgi()),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/round/(?P<round_seq>[-\w_]+)/panels/$', PanelEditConsumer.as_asgi()),
]),
),

# Worker handlers (which don't need a URL/protocol)
"channel": ChannelNameRouter({
# Name used in runworker cmd : SyncConsumer responsible
"notifications": NotificationQueueConsumer, # Email sending
"adjallocation": AdjudicatorAllocationWorkerConsumer,
"venues": VenuesWorkerConsumer,
"notifications": NotificationQueueConsumer.as_asgi(), # Email sending
"adjallocation": AdjudicatorAllocationWorkerConsumer.as_asgi(),
"venues": VenuesWorkerConsumer.as_asgi(),
}),
})