Created
January 8, 2016 16:58
-
-
Save emschwar/5b687e6956a3026b6712 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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