Module: EventMachine::Protocols::Stomp
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
self,
LineText2
|
|
Defined in: | lib/em/protocols/stomp.rb |
Overview
Implements Stomp (http://docs.codehaus.org/display/STOMP/Protocol).
Usage example
module StompClient 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 }
Constant Summary
LineText2
- Included
Instance Method Summary
-
#ack(msgid)
ACK command, for acknowledging receipt of messages.
-
#connect(parms = {})
CONNECT command, for authentication.
- #init_message_reader Internal use only Internal use only
- #receive_binary_data(data) Internal use only Internal use only
- #receive_line(line) Internal use only Internal use only
-
#receive_msg(msg)
Invoked with an incoming
Message
received from the STOMP server. -
#send(destination, body, parms = {})
SEND command, for publishing messages to a topic.
- #send_frame(verb, headers = {}, body = "") Internal use only Internal use only
-
#subscribe(dest, ack = false)
SUBSCRIBE command, for subscribing to topics.