Class: Ansible::SSE
- Inherits:
-
Object
- Object
- Ansible::SSE
- Defined in:
- lib/ansible/sse.rb
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(stream) ⇒ SSE
constructor
A new instance of SSE.
- #write(event, message) ⇒ Object
Constructor Details
#initialize(stream) ⇒ SSE
Returns a new instance of SSE.
5 6 7 |
# File 'lib/ansible/sse.rb', line 5 def initialize(stream) @stream = stream end |
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
3 4 5 |
# File 'lib/ansible/sse.rb', line 3 def stream @stream end |
Instance Method Details
#close ⇒ Object
15 16 17 |
# File 'lib/ansible/sse.rb', line 15 def close stream.close end |
#write(event, message) ⇒ Object
9 10 11 12 13 |
# File 'lib/ansible/sse.rb', line 9 def write(event, ) stream.write "event: #{event}\n" stream.write "retry: 1000\n" stream.write "data: #{}\n\n" end |