Class: GoogleSubscriber::BaseSubscriber
- Inherits:
-
Object
- Object
- GoogleSubscriber::BaseSubscriber
- Extended by:
- SubscriptionStarter
- Defined in:
- lib/google_subscriber/base_subscriber.rb
Constant Summary
Constants included from SubscriptionStarter
SubscriptionStarter::DEFAULT_SUBSCRIPTION_LISTEN_ARGS
Class Attribute Summary collapse
-
.g_credentials ⇒ Object
readonly
Returns the value of attribute g_credentials.
-
.g_project_id ⇒ Object
readonly
Returns the value of attribute g_project_id.
-
.g_subscription_id ⇒ Object
readonly
Returns the value of attribute g_subscription_id.
-
.g_subscription_listen_args ⇒ Object
readonly
Returns the value of attribute g_subscription_listen_args.
Class Method Summary collapse
- .subscription_credentials(creds) ⇒ Object
-
.subscription_id(subscription_id) ⇒ Object
Macro for specifying the subscription_id.
- .subscription_listen_args(args) ⇒ Object
- .subscription_project_id(project_id) ⇒ Object
Instance Method Summary collapse
-
#on_received_message(_received_message) ⇒ Object
Subclasses must override this method or method(s) of the form ‘on_received_#messagemessage.data_event_message`.
Methods included from SubscriptionStarter
build_listen_args, create_subscription, on_received_wrapper, start
Class Attribute Details
.g_credentials ⇒ Object (readonly)
Returns the value of attribute g_credentials.
15 16 17 |
# File 'lib/google_subscriber/base_subscriber.rb', line 15 def g_credentials @g_credentials end |
.g_project_id ⇒ Object (readonly)
Returns the value of attribute g_project_id.
15 16 17 |
# File 'lib/google_subscriber/base_subscriber.rb', line 15 def g_project_id @g_project_id end |
.g_subscription_id ⇒ Object (readonly)
Returns the value of attribute g_subscription_id.
15 16 17 |
# File 'lib/google_subscriber/base_subscriber.rb', line 15 def g_subscription_id @g_subscription_id end |
.g_subscription_listen_args ⇒ Object (readonly)
Returns the value of attribute g_subscription_listen_args.
15 16 17 |
# File 'lib/google_subscriber/base_subscriber.rb', line 15 def g_subscription_listen_args @g_subscription_listen_args end |
Class Method Details
.subscription_credentials(creds) ⇒ Object
24 25 26 |
# File 'lib/google_subscriber/base_subscriber.rb', line 24 def subscription_credentials(creds) @g_credentials = creds end |
.subscription_id(subscription_id) ⇒ Object
Macro for specifying the subscription_id
19 20 21 22 |
# File 'lib/google_subscriber/base_subscriber.rb', line 19 def subscription_id(subscription_id) @g_subscription_id = subscription_id GoogleSubscriber.register_subscriber(self) end |
.subscription_listen_args(args) ⇒ Object
33 34 35 |
# File 'lib/google_subscriber/base_subscriber.rb', line 33 def subscription_listen_args(args) @g_subscription_listen_args = args end |
.subscription_project_id(project_id) ⇒ Object
28 29 30 |
# File 'lib/google_subscriber/base_subscriber.rb', line 28 def subscription_project_id(project_id) @g_project_id = project_id end |
Instance Method Details
#on_received_message(_received_message) ⇒ Object
Subclasses must override this method or method(s) of the form ‘on_received_#GoogleSubscriber::BaseSubscriber.messagemessage.data_event_message`. It is called as messages are received Remember to acknowledge the `received_message` googleapis.dev/ruby/google-cloud-pubsub/latest/Google/Cloud/PubSub/ReceivedMessage.html
10 11 12 |
# File 'lib/google_subscriber/base_subscriber.rb', line 10 def () raise 'must override!' end |