Class: FeatureHub::Sdk::StreamingEdgeService
- Inherits:
-
EdgeService
- Object
- EdgeService
- FeatureHub::Sdk::StreamingEdgeService
- Defined in:
- lib/feature_hub/sdk/streaming_edge_service.rb
Overview
provides a streaming service
Instance Attribute Summary collapse
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#sse_client ⇒ Object
readonly
Returns the value of attribute sse_client.
-
#stopped ⇒ Object
readonly
Returns the value of attribute stopped.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #active ⇒ Object
- #close ⇒ Object
- #closed ⇒ Object
-
#initialize(repository, api_keys, edge_url, logger = nil) ⇒ StreamingEdgeService
constructor
A new instance of StreamingEdgeService.
- #poll ⇒ Object
Constructor Details
#initialize(repository, api_keys, edge_url, logger = nil) ⇒ StreamingEdgeService
Returns a new instance of StreamingEdgeService.
12 13 14 15 16 17 18 19 20 |
# File 'lib/feature_hub/sdk/streaming_edge_service.rb', line 12 def initialize(repository, api_keys, edge_url, logger = nil) super(repository, api_keys, edge_url) @url = "#{edge_url}features/#{api_keys[0]}" @repository = repository @sse_client = nil @context = nil @logger = logger || FeatureHub::Sdk.default_logger end |
Instance Attribute Details
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
10 11 12 |
# File 'lib/feature_hub/sdk/streaming_edge_service.rb', line 10 def repository @repository end |
#sse_client ⇒ Object (readonly)
Returns the value of attribute sse_client.
10 11 12 |
# File 'lib/feature_hub/sdk/streaming_edge_service.rb', line 10 def sse_client @sse_client end |
#stopped ⇒ Object (readonly)
Returns the value of attribute stopped.
10 11 12 |
# File 'lib/feature_hub/sdk/streaming_edge_service.rb', line 10 def stopped @stopped end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
10 11 12 |
# File 'lib/feature_hub/sdk/streaming_edge_service.rb', line 10 def url @url end |
Instance Method Details
#active ⇒ Object
30 31 32 |
# File 'lib/feature_hub/sdk/streaming_edge_service.rb', line 30 def active !@sse_client.nil? end |
#close ⇒ Object
34 35 36 |
# File 'lib/feature_hub/sdk/streaming_edge_service.rb', line 34 def close close_connection end |
#closed ⇒ Object
22 23 24 |
# File 'lib/feature_hub/sdk/streaming_edge_service.rb', line 22 def closed @sse_client.nil? end |
#poll ⇒ Object
26 27 28 |
# File 'lib/feature_hub/sdk/streaming_edge_service.rb', line 26 def poll start_streaming unless @sse_client || @stopped end |