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

Update Sock contract to mirror Phoenix.Socket.Transport #2

Merged
merged 2 commits into from
Oct 17, 2022
Merged

Conversation

mtrudel
Copy link
Member

@mtrudel mtrudel commented Oct 16, 2022

As discussed at phoenixframework/phoenix#4973 and planned for in phoenixframework/phoenix#5003, this work updates the Sock API to mirror Phoenix.Socket.Transport, with a few additive changes:

  • c:Sock.init/1 can now return the same set of tuples as c:Sock.handle_in/2 et al. This allows init to send messages at connection time
  • c:Sock.terminate/1 defines more possible arguments, codifying a number of common termination reasons such as server shutdown or timeout.
  • Any of the callbacks which return {:push, ...} or {:reply, ...} may indicate the transmission of any type of frame
  • c:Phoenix.Socket.Transport.start_link/1 moves to c:Phoenix.Socket.start_link/1

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.

None yet

1 participant