Sha256: 8dba9f74382be11954913337749cbc14be126a8b0472ea3998d702ba5778b5c1

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

# encoding: ascii-8bit

# Copyright 2022 Ball Aerospace & Technologies Corp.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# This program may also be used under the terms of a commercial or
# enterprise edition license of COSMOS if purchased from the
# copyright holder

require 'cosmos/utilities/store'

module Cosmos
  class Topic
    def self.initialize_streams(topics)
      Store.initialize_streams(topics)
    end

    def self.read_topics(topics, offsets = nil, timeout_ms = 1000, &block)
      Store.read_topics(topics, offsets, timeout_ms, &block)
    end

    def self.clear_topics(topics, maxlen = 0)
      topics.each do |topic|
        Store.xtrim(topic, maxlen)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cosmos-5.0.2 lib/cosmos/topics/topic.rb
cosmos-5.0.2.pre.beta2 lib/cosmos/topics/topic.rb