Sha256: f143fc6c13d94535258a103ce35ddbb47de54b95d537cc1f3c0278aed51680c5
Contents?: true
Size: 1.51 KB
Versions: 21
Compression:
Stored size: 1.51 KB
Contents
module Fog module Google class Pubsub class Real # Pulls from a subscription. If option 'return_immediately' is # false, then this method blocks until one or more messages is # available or the remote server closes the connection. # # @param subscription [Subscription, #to_s] subscription instance or # name of subscription to pull from # @param options [Hash] options to modify the pull request # @option options [Boolean] :return_immediately if true, method returns # after API call; otherwise the connection is held open until # messages are available or the remote server closes the connection # (defaults to true) # @option options [Number] :max_messages maximum number of messages to # retrieve (defaults to 10) # @see https://cloud.google.com/pubsub/reference/rest/v1/projects.subscriptions/pull def pull_subscription(subscription, options = { :return_immediately => true, :max_messages => 10 }) pull_request = ::Google::Apis::PubsubV1::PullRequest.new( :return_immediately => options[:return_immediately], :max_messages => options[:max_messages] ) @pubsub.pull_subscription(subscription, pull_request) end end class Mock def pull_subscription(_subscription, _options = { :return_immediately => true, :max_messages => 10 }) raise Fog::Errors::MockNotImplemented end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems