Unleash v1.7.0 Unleash.Strategy.GradualRolloutUserId View Source

Requires :user_id in Unleash.context/0

Based on the gradualRolloutUserId strategy.

Link to this section Summary

Functions

You can implmenet this callback a couple of ways, returning a bare boolean() or a {boolean, map()}. The latter is preferred, as it generates a :debug level log entry detailing the name of the strategy, the result, and the contents of map(), in an effort to help understand why the result was what it was.

Link to this section Functions

Link to this function

enabled?(params, context)

View Source

You can implmenet this callback a couple of ways, returning a bare boolean() or a {boolean, map()}. The latter is preferred, as it generates a :debug level log entry detailing the name of the strategy, the result, and the contents of map(), in an effort to help understand why the result was what it was.

Arguments

  • parameters - A map of paramters returned from the Unleash server. This can be whatever you like, such as a configured list of userIds.
  • context - The context passed into Unleash.enabled?/3.

Examples

@behaviour Unleash.Strategy

def enabled?(params, context), do: {false, params}

def enabled(params, %{}), do: false

Callback implementation for Unleash.Strategy.enabled?/2.