Sha256: af8b496c53d4d4bb6e1e82c14287f65583badeaf6a0af013941be4157d91995b

Contents?: true

Size: 283 Bytes

Versions: 26

Compression:

Stored size: 283 Bytes

Contents

module Routemaster
  module Middleware
    class PayloadFilter
      # Filters duplicate events by url and type in a single payload.
      def run(payload)
        payload.group_by { |event| [event['url'], event['type']] }.map { |_, events| events.last }
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
routemaster-drain-3.7.1 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.7.0 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.6.8 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.6.7 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.6.6 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.6.5 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.6.4 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.6.3 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.6.2 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.6.1 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.6.0 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.5.1 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.5.0 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.4.0 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.3.0 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.2.0 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.1.0 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.0.3 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.0.2 lib/routemaster/middleware/payload_filter.rb
routemaster-drain-3.0.1 lib/routemaster/middleware/payload_filter.rb