Class: Insika::Event
- Inherits:
-
Data
- Object
- Data
- Insika::Event
- Defined in:
- lib/insika/event.rb
Overview
Everything the runtime emits is an Event: a closed canonical catalog — new types require updating the catalog.
meta: { task_id:, session_id:, seq:, at: } (seq monotonic per task). Terminal turn events are :task_completed / :task_failed / :task_cancelled. :error is NOT a terminal twin — it survives only as the subscription-overflow signal (EventStream) and the post-terminal failure report (fail_task).
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, data:, meta: {}) ⇒ Event
constructor
A new instance of Event.
- #to_h ⇒ Object
Constructor Details
#initialize(type:, data:, meta: {}) ⇒ Event
Returns a new instance of Event.
12 13 14 |
# File 'lib/insika/event.rb', line 12 def initialize(type:, data:, meta: {}) super end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data
11 12 13 |
# File 'lib/insika/event.rb', line 11 def data @data end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta
11 12 13 |
# File 'lib/insika/event.rb', line 11 def @meta end |
#type ⇒ Object (readonly)
Returns the value of attribute type
11 12 13 |
# File 'lib/insika/event.rb', line 11 def type @type end |
Instance Method Details
#to_h ⇒ Object
16 |
# File 'lib/insika/event.rb', line 16 def to_h = { type:, **data, meta: .compact } |