Class: NATS::JetStream::API::ConsumerInfo

Inherits:
Struct show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb

Overview

ConsumerInfo is the current status of a JetStream consumer.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

#as_json

Constructor Details

#initialize(opts = {}) ⇒ ConsumerInfo

Returns a new instance of ConsumerInfo.



71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 71

def initialize(opts={})
  opts[:created] = Time.parse(opts[:created])
  opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
  opts[:delivered] = SequenceInfo.new(opts[:delivered])
  opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
  opts[:config] = ConsumerConfig.new(opts[:config])
  opts.delete(:cluster)
  # Filter unrecognized fields just in case.
  rem = opts.keys - members
  opts.delete_if { |k| rem.include?(k) }
  super(opts)
  freeze
end

Instance Attribute Details

#ack_floorSequenceInfo

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#clusterHash

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#configConsumerConfig

Returns consumer configuration.

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#createdString

Returns time when the consumer was created.

Returns:

  • (String)

    time when the consumer was created.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#deliveredSequenceInfo

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#nameString

Returns name of the consumer.

Returns:

  • (String)

    name of the consumer.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#num_ack_pendingInteger

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#num_pendingInteger

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#num_redeliveredInteger

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#num_waitingInteger

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#push_boundObject

Returns the value of attribute push_bound

Returns:

  • (Object)

    the current value of push_bound



66
67
68
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

def push_bound
  @push_bound
end

#stream_nameString

Returns name of the stream to which the consumer belongs.

Returns:

  • (String)

    name of the stream to which the consumer belongs.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



66
67
68
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 66

def type
  @type
end