Skip to content

Instantly share code, notes, and snippets.

@emschwar
Created January 8, 2016 16:58
Show Gist options
  • Save emschwar/5b687e6956a3026b6712 to your computer and use it in GitHub Desktop.
Save emschwar/5b687e6956a3026b6712 to your computer and use it in GitHub Desktop.
defmodule Socket do
defstruct socket: nil, transport: nil
use GenServer
def handle_info({:send, payload}, state=%Socket{socket: socket, transport: transport}) do
transport.send(socket, payload)
{ :noreply, state }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment