Last active
December 12, 2015 07:28
-
-
Save knowtheory/4736476 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| module Sullivans | |
| class UserActor | |
| include Celluloid | |
| include Celluloid::Notifications | |
| include Celluloid::Logger | |
| def initialize(socket) | |
| # Subscribe to conversations | |
| info "Started a client" | |
| @socket = socket | |
| @socket.on_message do |msg| | |
| info msg | |
| write msg | |
| end | |
| @socket.read_every 1 | |
| end | |
| def write(msg) | |
| info "Got a message" | |
| @socket.write("Recieved #{msg}") | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment