Sha256: 59a1c96e1ccdf6246a62c9323c2db7cfb27ea32fa731d1bbc7c39a18d70fdb64

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

# frozen_string_literal: true

# https://upstash.com/docs/qstash/api/messages/bulk-cancel
module Qstash
  module Message
    class BulkCancel
      include Qstash::Callable
      attr_reader :message_ids, :headers

      def initialize(message_ids, headers: {})
        @message_ids = message_ids
        @headers = headers
      end

      def call
        uri = URI(endpoint)
        client = Qstash::HttpClient.new(uri)
        client.delete({messageIds: message_ids}, headers)
      end

      private

      def endpoint
        [
          Qstash.config.url.sub(/\/$/, ""),
          Endpoints::BULK_CANCEL_ENDPOINT
        ].join("/")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qstash-rb-0.1.2 lib/qstash/message/bulk_cancel.rb