Class: SimpleAcp::Models::Event Abstract
- Defined in:
- lib/simple_acp/models/events.rb
Overview
This class is abstract.
Subclass and set type in initializer
Base class for all Server-Sent Events (SSE).
Events are streamed during run execution to provide real-time updates on progress and output.
Direct Known Subclasses
ErrorEvent, GenericEvent, MessageCompletedEvent, MessageCreatedEvent, MessagePartEvent, RunAwaitingEvent, RunCancelledEvent, RunCompletedEvent, RunCreatedEvent, RunFailedEvent, RunInProgressEvent
Instance Attribute Summary collapse
-
#type ⇒ String
readonly
Event type (see Types::EventType).
Instance Method Summary collapse
-
#sse_format ⇒ String
Format for Server-Sent Events protocol.
Methods inherited from Base
#==, attribute, attributes, from_hash, #hash, #initialize, own_attributes, #to_h, #to_json
Constructor Details
This class inherits a constructor from SimpleAcp::Models::Base
Instance Attribute Details
#type ⇒ String (readonly)
Returns event type (see Types::EventType).
14 |
# File 'lib/simple_acp/models/events.rb', line 14 attribute :type, required: true |
Instance Method Details
#sse_format ⇒ String
Format for Server-Sent Events protocol.
19 20 21 |
# File 'lib/simple_acp/models/events.rb', line 19 def sse_format "event: #{@type}\ndata: #{to_json}\n\n" end |