Skip to main content

FeatureProtocol

PROTOCOL

FeatureProtocol

public protocol FeatureProtocol: AnyObject

Describes a feature generated from the Causal SDK.

Properties

name

static var name: String

The name of the feature.

args

var args: Args

The arguments associated with this instance of the feature.

status

var status: FeatureStatus<Outputs>

Indicates the current status of the feature

Methods

update(request:)

func update(request: FeatureUpdateRequest) throws

Update the instance of this feature

  • Warning This method is intended for CausalClient use only.

event(_:)

func event(_ event: Event) -> FeatureEventPayload?

Generates a FeatureEventPayload from the instance of the feature which will correctly associate the event with the feature's impression id.

  • Parameter event: The Event to signal
  • Returns: Payload object with the correct Event and ImpressionId to use when signaling. This will return nil if the feature has not been successfully requested from the CausalClient.

Parameters

NameDescription
eventThe Event to signal

clone()

func clone() -> Self

Returns a new instance of the feature copying over all necessary data.