Closed ckrew closed 6 months ago
I updated this PR after reviewing some feedback. The main thing was keeping user experience consistent with regards to decorators. Users can now use the new capabilities just like a controller by supplying arguments in the decorator. An example is below:
The methods for connecting and disconnecting have now been separated according to user authorization. So there is now a "authorized_connect", "unauthorized_connect", "authorized_disconnect", and "unauthorized_disconnect" so that developers can handle whatever use case they experience.
For the backend, the solution was using a mixin and dynamically adding new methods from the mixin to the decorated class. This works for both async and sync websockets as well.
@swainn It looks like the Docker build is failing because the secrets.DOCKER_UPLOAD_URL
is not being substituted in correctly. I'm not sure why that would be the case. On successful jobs it looks like this: ***:dev
, but in this one its just :dev
.
I think we decided that the docker build won't work because this is being merged from a fork. Once other checks pass then I approve merging.
This PR is to resolve issue https://github.com/tethysplatform/tethys/issues/1009.
The newly created TethysAsyncWebsocketConsumer class will replace the AsyncWebsocketConsumer class. The new TethysAsyncWebsocketConsumer class has the following capabilities:
The websocket tutorial docs have been updated as well to show the new capabilities.