class PubsubClient::Publisher

Attributes

topic[R]

Public Class Methods

new(topic) click to toggle source

@param topic [Google::Cloud::PubSub::Topic]

# File lib/pubsub_client/publisher.rb, line 8
def initialize(topic)
  @topic = topic
end

Public Instance Methods

flush() click to toggle source
# File lib/pubsub_client/publisher.rb, line 16
def flush
  return unless topic.async_publisher
  topic.async_publisher.stop.wait!
end
publish(message, attributes = {}, &block) click to toggle source
# File lib/pubsub_client/publisher.rb, line 12
def publish(message, attributes = {}, &block)
  topic.publish_async(message, attributes, &block)
end