Class: RedfishTools::SseClient
- Inherits:
-
Object
- Object
- RedfishTools::SseClient
- Defined in:
- lib/redfish_tools/sse_client.rb
Instance Method Summary collapse
-
#initialize(address) ⇒ SseClient
constructor
A new instance of SseClient.
- #start ⇒ Object
Constructor Details
#initialize(address) ⇒ SseClient
Returns a new instance of SseClient.
9 10 11 |
# File 'lib/redfish_tools/sse_client.rb', line 9 def initialize(address) @address = address end |
Instance Method Details
#start ⇒ Object
13 14 15 16 17 18 |
# File 'lib/redfish_tools/sse_client.rb', line 13 def start ServerSentEvents.listen(@address) do |event| puts JSON.pretty_generate("id" => event.id, "data" => JSON.parse(event.data)) end end |