Skip to content

Commit

Permalink
define how context can be managed for named provider using static con…
Browse files Browse the repository at this point in the history
…text paradigm (#221)

Signed-off-by: Michael Beemer <[email protected]>
  • Loading branch information
beeme1mr authored Dec 8, 2023
1 parent c4b66e4 commit 5ed6c0c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 5 deletions.
25 changes: 23 additions & 2 deletions specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,20 @@
"content": "The Client and invocation MUST NOT have a method for supplying `evaluation context`.",
"RFC 2119 keyword": "MUST NOT",
"children": []
},
{
"id": "Conditional Requirement 3.2.2.3",
"machine_id": "conditional_requirement_3_2_2_3",
"content": "The API MUST have a method for setting `evaluation context` for a provider bound to a named client.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Conditional Requirement 3.2.2.4",
"machine_id": "conditional_requirement_3_2_2_4",
"content": "The API MUST have a a mechanism to manage `evaluation context` for an associated name.",
"RFC 2119 keyword": "MUST",
"children": []
}
]
},
Expand All @@ -536,11 +550,18 @@
"RFC 2119 keyword": null,
"children": [
{
"id": "Requirement 3.2.4.1",
"machine_id": "requirement_3_2_4_1",
"id": "Conditional Requirement 3.2.4.1",
"machine_id": "conditional_requirement_3_2_4_1",
"content": "When the global `evaluation context` is set, the `on context changed` handler MUST run.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Conditional Requirement 3.2.4.2",
"machine_id": "conditional_requirement_3_2_4_2",
"content": "When the `evaluation context` for a specific provider is set, the `on context changed` handler MUST only run on the associated provider.",
"RFC 2119 keyword": "MUST",
"children": []
}
]
},
Expand Down
28 changes: 25 additions & 3 deletions specification/sections/03-evaluation-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,23 @@ API (global) `evaluation context` can be used to supply data to flag evaluation,

> The Client and invocation **MUST NOT** have a method for supplying `evaluation context`.
In the static-context paradigm, context is global. The client and invocation cannot supply evaluation context.
In the static-context paradigm, context is global. The client and invocation cannot supply evaluation context.

##### Conditional Requirement 3.2.2.3

> The API **MUST** have a method for setting `evaluation context` for a provider bound to a named client.
In the static-context paradigm, provider specific context can be set using the associated name.
The global context is used if there is no matching provider specific context.

See [setting a provider](./01-flag-evaluation.md#setting-a-provider) for details.

##### Conditional Requirement 3.2.2.4

> The API **MUST** have a a mechanism to manage `evaluation context` for an associated name.
In the static-context paradigm, it must be possible to create and remove provider-specific context.
See [setting a provider](./01-flag-evaluation.md#setting-a-provider) for details.

#### Requirement 3.2.3

Expand All @@ -102,8 +118,14 @@ flowchart LR
see: [static-context paradigm](../glossary.md#static-context-paradigm)

##### Requirement 3.2.4.1
##### Conditional Requirement 3.2.4.1

> When the global `evaluation context` is set, the `on context changed` handler **MUST** run.
The SDK implementation must run the `on context changed` handler on the registered provider whenever the global `evaluation context` is mutated.
The SDK implementation must run the `on context changed` handler on all registered provider that use the global `evaluation context` whenever it is mutated.

##### Conditional Requirement 3.2.4.2

> When the `evaluation context` for a specific provider is set, the `on context changed` handler **MUST** only run on the associated provider.
The SDK implementation must run the `on context changed` handler only on the provider that is scoped to the mutated `evaluation context`.

0 comments on commit 5ed6c0c

Please sign in to comment.