Class: Upkeep::Dependencies::RequestValue

Inherits:
Identity show all
Defined in:
lib/upkeep/dependencies.rb

Constant Summary collapse

DEPLOYMENT_STABLE_KEYS =

Request values that are stable for a deployment/connection rather than a viewer. They never partition subscribers, but their fingerprints are folded into shared stream names (see SharedStreams.deployment_signature_for) so viewers with different values can never share a stream.

%w[host port protocol ssl request_method].freeze

Instance Attribute Summary

Attributes inherited from Base

#key, #metadata, #source

Instance Method Summary collapse

Methods inherited from Identity

#identity?, #identity_key, #nil_identity?, #precision, #visibility

Methods inherited from Base

#cache_key, #identity?, #identity_key, #matches_change?, #narrow_frame_safe?, #precision, #to_h, #visibility

Constructor Details

#initialize(key:, value:) ⇒ RequestValue

Returns a new instance of RequestValue.



407
408
409
410
411
412
413
414
415
# File 'lib/upkeep/dependencies.rb', line 407

def initialize(key:, value:)
  super(
    source: :request,
    key: key.to_s,
    value: Dependencies.private_fingerprint(value),
    metadata: { key: key.to_s, value_class: value.class.name },
    partitioning: DEPLOYMENT_STABLE_KEYS.include?(key.to_s) ? false : nil
  )
end