Skip to content

Commit

Permalink
docs: add language-specific initialize naming (#244)
Browse files Browse the repository at this point in the history
Signed-off-by: Max VelDink <[email protected]>
Co-authored-by: Todd Baert <[email protected]>
  • Loading branch information
maxveldink and toddbaert authored Feb 9, 2024
1 parent b58c3b4 commit 2c36abd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@
{
"id": "Requirement 2.4.1",
"machine_id": "requirement_2_4_1",
"content": "The `provider` MAY define an `initialize` function which accepts the global `evaluation context` as an argument and performs initialization logic relevant to the provider.",
"content": "The `provider` MAY define an initialization function which accepts the global `evaluation context` as an argument and performs initialization logic relevant to the provider.",
"RFC 2119 keyword": "MAY",
"children": []
},
Expand Down
10 changes: 5 additions & 5 deletions specification/sections/02-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ ResolutionDetails<MyStruct> resolveStructureValue(string flagKey, MyStruct defau
```
##### Requirement 2.2.9

> The `provider` **SHOULD** populate the `resolution details` structure's `flag metadata` field.
> The `provider` **SHOULD** populate the `resolution details` structure's `flag metadata` field.
##### Requirement 2.2.10

Expand Down Expand Up @@ -164,11 +164,11 @@ class MyProvider implements Provider {

#### Requirement 2.4.1

> The `provider` **MAY** define an `initialize` function which accepts the global `evaluation context` as an argument and performs initialization logic relevant to the provider.
> The `provider` **MAY** define an initialization function which accepts the global `evaluation context` as an argument and performs initialization logic relevant to the provider.
Many feature flag frameworks or SDKs require some initialization before they can be used.
They might require the completion of an HTTP request, establishing persistent connections, or starting timers or worker threads.
The `initialization` function is an ideal place for such logic.
The initialization function is an ideal place for such logic.

```java
// MyProvider implementation of the initialize function defined in Provider
Expand Down Expand Up @@ -281,7 +281,7 @@ class MyProvider implements Provider {
//...
onContextChanged(EvaluationContext oldContext, EvaluationContext newContext): void {
// update context-sensitive cached flags, or otherwise react to the change in the global context
// update context-sensitive cached flags, or otherwise react to the change in the global context
}
//...
Expand All @@ -290,4 +290,4 @@ class MyProvider implements Provider {
Providers may maintain remote connections, timers, threads or other constructs that need to be appropriately disposed of.
Provider authors may implement a `shutdown` function to perform relevant clean-up actions.
Alternatively, implementations might leverage language idioms such as auto-disposable interfaces or some means of cancellation signal propagation to allow for graceful shutdown.
Alternatively, implementations might leverage language idioms such as auto-disposable interfaces or some means of cancellation signal propagation to allow for graceful shutdown.

0 comments on commit 2c36abd

Please sign in to comment.