Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Add example for EM::Protocols::Stomp
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Feb 8, 2009
1 parent a0da1c5 commit 2bffede
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/protocols/stomp.rb
Expand Up @@ -31,6 +31,29 @@ module Protocols

# Implements Stomp (http://docs.codehaus.org/display/STOMP/Protocol).
#
# == Usage example
#
# class StompClient < EM::Connection
# include EM::Protocols::Stomp
#
# def connection_completed
# connect :login => 'guest', :passcode => 'guest'
# end
#
# def receive_msg msg
# if msg.command == "CONNECTED"
# subscribe '/some/topic'
# else
# p ['got a message', msg]
# puts msg.body
# end
# end
# end
#
# EM.run{
# EM.connect 'localhost', 61613, StompClient
# }
#
module Stomp
include LineText2

Expand Down

0 comments on commit 2bffede

Please sign in to comment.