Class: PubsubClient
- Inherits:
-
Object
show all
- Defined in:
- lib/pubsub_client.rb,
lib/pubsub_client/version.rb,
lib/pubsub_client/publisher.rb,
lib/pubsub_client/subscriber.rb,
lib/pubsub_client/null_publisher.rb,
lib/pubsub_client/null_subscriber.rb,
lib/pubsub_client/publisher_factory.rb,
lib/pubsub_client/subscriber_factory.rb,
lib/pubsub_client/null_publisher_factory.rb,
lib/pubsub_client/null_subscriber_factory.rb
Defined Under Namespace
Classes: NullPublisher, NullPublisherFactory, NullSubscriber, NullSubscriberFactory, Publisher, PublisherFactory, Subscriber, SubscriberFactory
Constant Summary
collapse
- Error =
Class.new(StandardError)
- ConfigurationError =
Class.new(Error)
- CredentialsError =
Class.new(Error)
- InvalidTopicError =
Class.new(Error)
- InvalidSubscriptionError =
Class.new(Error)
- VERSION =
'2.0.0'
Instance Method Summary
collapse
Instance Method Details
#publish(message, topic, attributes = {}, &block) ⇒ Object
32
33
34
35
36
37
|
# File 'lib/pubsub_client.rb', line 32
def publish(message, topic, attributes = {}, &block)
ensure_credentials!
@publisher_factory ||= PublisherFactory.new
@publisher_factory.build(topic).publish(message, attributes, &block)
end
|
#subscriber(subscription) ⇒ Object
25
26
27
28
29
30
|
# File 'lib/pubsub_client.rb', line 25
def subscriber(subscription)
ensure_credentials!
@subscriber_factory ||= SubscriberFactory.new
@subscriber_factory.build(subscription)
end
|