Class: Tempest::Jetstream::StreamStatus

Inherits:
Data
  • Object
show all
Defined in:
lib/tempest/jetstream/stream_manager.rb

Overview

Lifecycle status emitted alongside Event/StreamError on the same on_event callback so the REPL can render “– disconnected” / “– reconnecting” / “– live” lines without coupling to the manager’s internals. ‘state` is one of :disconnected | :reconnecting | :live | :gapped. `reason` is :closed | :error for :disconnected. `error` is the underlying exception when reason == :error. `since` is the disconnect time when state == :gapped.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state:, reason: nil, error: nil, since: nil) ⇒ StreamStatus

Returns a new instance of StreamStatus.



263
264
265
# File 'lib/tempest/jetstream/stream_manager.rb', line 263

def initialize(state:, reason: nil, error: nil, since: nil)
  super
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



262
263
264
# File 'lib/tempest/jetstream/stream_manager.rb', line 262

def error
  @error
end

#reasonObject (readonly)

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



262
263
264
# File 'lib/tempest/jetstream/stream_manager.rb', line 262

def reason
  @reason
end

#sinceObject (readonly)

Returns the value of attribute since

Returns:

  • (Object)

    the current value of since



262
263
264
# File 'lib/tempest/jetstream/stream_manager.rb', line 262

def since
  @since
end

#stateObject (readonly)

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



262
263
264
# File 'lib/tempest/jetstream/stream_manager.rb', line 262

def state
  @state
end