Sha256: a691f74c24f2418ae1048e5a18623b254b31082dcf6362cd663f060a32646ca6

Contents?: true

Size: 471 Bytes

Versions: 34

Compression:

Stored size: 471 Bytes

Contents

module Messaging
  module Adapters
    class Postgres
      class Streams
        include Enumerable

        def each
          return enum_for(:each) unless block_given?

          all_streams.each do |name|
            yield Stream.new(name)
          end
        end

        def [](name)
          Stream.new(name)
        end

        private

        def all_streams
          SerializedMessage.distinct.pluck(:stream).lazy
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
messaging-4.0.12 lib/messaging/adapters/postgres/streams.rb
messaging-4.0.11 lib/messaging/adapters/postgres/streams.rb
messaging-4.0.10 lib/messaging/adapters/postgres/streams.rb
messaging-4.0.10.pre lib/messaging/adapters/postgres/streams.rb
messaging-4.0.9 lib/messaging/adapters/postgres/streams.rb
messaging-4.0.8 lib/messaging/adapters/postgres/streams.rb
messaging-4.0.7 lib/messaging/adapters/postgres/streams.rb
messaging-4.0.6 lib/messaging/adapters/postgres/streams.rb
messaging-4.0.5 lib/messaging/adapters/postgres/streams.rb
messaging-4.0.4.pre lib/messaging/adapters/postgres/streams.rb
messaging-4.0.3.pre lib/messaging/adapters/postgres/streams.rb
messaging-4.0.2.pre lib/messaging/adapters/postgres/streams.rb
messaging-4.0.1.pre lib/messaging/adapters/postgres/streams.rb
messaging-4.0.0.pre lib/messaging/adapters/postgres/streams.rb
messaging-3.8.2 lib/messaging/adapters/postgres/streams.rb
messaging-3.8.1 lib/messaging/adapters/postgres/streams.rb
messaging-3.8.0 lib/messaging/adapters/postgres/streams.rb
messaging-3.7.3 lib/messaging/adapters/postgres/streams.rb
messaging-3.7.2 lib/messaging/adapters/postgres/streams.rb
messaging-3.7.1 lib/messaging/adapters/postgres/streams.rb