Class | OpenWFE::XmlSocketParticipant |
In: |
lib/openwfe/participants/socketparticipants.rb
|
Parent: | SocketParticipant |
This extension of of SocketParticipant can be used to dispatch workitems towards an OpenWFEja instance, but OpenWFEru‘s SocketListener understands XML workitems as well.
A ‘static’ method for dispatching workitems, you can use it directly, without instantiating the SocketParticipant :
require 'openwfe/participants/socketparticipants' SocketParticipant.dispatch("127.0.0.1", 7007, workitem)
# File lib/openwfe/participants/socketparticipants.rb, line 177 177: def XmlSocketParticipant.dispatch (host, port, workitem) 178: 179: XmlSocketParticipant.new(host, port).consume(workitem) 180: end
This implementation encodes the workitem as an XML document. This is compatible with OpenWFEja.
# File lib/openwfe/participants/socketparticipants.rb, line 188 188: def encode_workitem (wi) 189: 190: sxml = OpenWFE::XmlCodec::encode(wi) 191: 192: s = "xmlCoder #{sxml.length}\n" 193: s << "\n" 194: s << sxml 195: s << "\n" 196: s << "\n" 197: s 198: end