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

Fix when a method is passed as an endpoint and init CBV #126 #128

Closed
wants to merge 4 commits into from
Closed

Fix when a method is passed as an endpoint and init CBV #126 #128

wants to merge 4 commits into from

Conversation

taoufik07
Copy link
Collaborator

ref #126 #127

@taoufik07
Copy link
Collaborator Author

taoufik07 commented Oct 23, 2018

@kennethreitz I see that you've removed websockets, this PR fixes the Route.is_function + the websocket problem (the issues that I've reported before)

@taoufik07
Copy link
Collaborator Author

taoufik07 commented Oct 23, 2018

@kennethreitz and I was about to add the last peace of the puzzle but you've closed the PR :/

A way of consuming websockets and handling Abnormal close
UPDATE

async def ws2(ws, greeting):
	await ws.accept()
	try:
		while True:
			name = await ws.text()
			print(name)
			await ws.send_text(f"{greeting} {name} via ws!")
		await ws.close()
	except WebSocketDisconnect as e:
		print("Closed by the client")
	finally:
		print("post stuff")

@taoufik07
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants