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

Add Websocket support to Go functions #322

Open
khamonsol opened this issue Nov 6, 2023 · 0 comments
Open

Add Websocket support to Go functions #322

khamonsol opened this issue Nov 6, 2023 · 0 comments

Comments

@khamonsol
Copy link

Is your feature request related to a problem? Please describe.
Only in that I have a need for supporting web sockets and currently I can't without working outside of Fission

Describe the solution you'd like
I would like Fission to support web socket for Go functions

Describe alternatives you've considered
I could run my websocket endpoints outside of fission, but I don't really want to.

Additional context

Have discussed with @sanketsudake and I am going to take a shot at implementing this and submitting a PR.

Recently I have added support for Websockets in the Python environment.
You can take look at the changes at #243
Fetcher provides two APIs as of now which help us to track if there are any active websocket connections processed by the pod and prevents deletion of the pod.
I have defined these events in socket_tracker.py and called them via function _active_connection_event and _no_activity_event. These APIs are provided by the fetcher container(notice port 8000) running in the function pod.
WS_START_EVENT = “http://127.0.0.1:8000/wsevent/start”
WS_END_EVENT = “http://127.0.0.1:8000/wsevent/end”
When pod receives a websocket connection the calls start event
when there are not active connections it calls end event.
Calling start event prevents deletion of the pod
Calling the end event allows Fission to clean up the pod.
These APIs were recently added in fetcher. So you would need at least 1.13.1 release.

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

No branches or pull requests

1 participant