Class: Turbo::Train::FanoutConfiguration
- Inherits:
-
Object
- Object
- Turbo::Train::FanoutConfiguration
- Defined in:
- lib/turbo/train/config.rb
Instance Attribute Summary collapse
-
#fastly_api_url ⇒ Object
Returns the value of attribute fastly_api_url.
-
#fastly_key ⇒ Object
Returns the value of attribute fastly_key.
-
#service_id ⇒ Object
Returns the value of attribute service_id.
-
#service_url ⇒ Object
Returns the value of attribute service_url.
Instance Method Summary collapse
-
#initialize ⇒ FanoutConfiguration
constructor
A new instance of FanoutConfiguration.
- #listen_url(topic) ⇒ Object
- #publish_url ⇒ Object
Constructor Details
#initialize ⇒ FanoutConfiguration
Returns a new instance of FanoutConfiguration.
34 35 36 37 38 39 |
# File 'lib/turbo/train/config.rb', line 34 def initialize super @fastly_api_url = 'https://api.fastly.com' @service_url = 'https://johnny-cage-fake-url.edgecompute.app' @fastly_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' end |
Instance Attribute Details
#fastly_api_url ⇒ Object
Returns the value of attribute fastly_api_url.
32 33 34 |
# File 'lib/turbo/train/config.rb', line 32 def fastly_api_url @fastly_api_url end |
#fastly_key ⇒ Object
Returns the value of attribute fastly_key.
32 33 34 |
# File 'lib/turbo/train/config.rb', line 32 def fastly_key @fastly_key end |
#service_id ⇒ Object
Returns the value of attribute service_id.
32 33 34 |
# File 'lib/turbo/train/config.rb', line 32 def service_id @service_id end |
#service_url ⇒ Object
Returns the value of attribute service_url.
32 33 34 |
# File 'lib/turbo/train/config.rb', line 32 def service_url @service_url end |
Instance Method Details
#listen_url(topic) ⇒ Object
45 46 47 |
# File 'lib/turbo/train/config.rb', line 45 def listen_url(topic, **) "#{service_url}/stream/sse?topic=#{Turbo::Train.signed_stream_name(topic)}" end |
#publish_url ⇒ Object
41 42 43 |
# File 'lib/turbo/train/config.rb', line 41 def publish_url "#{@fastly_api_url}/service/#{@service_id}/publish/" end |