From 99f39a2b66618d4bbd86da3e77ace1fd9923af81 Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Thu, 8 Feb 2024 07:34:09 -0500 Subject: [PATCH 1/3] docs: add language-specific initialize naming Signed-off-by: Max VelDink --- specification/sections/02-providers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/sections/02-providers.md b/specification/sections/02-providers.md index 46a29dd5..5098d77e 100644 --- a/specification/sections/02-providers.md +++ b/specification/sections/02-providers.md @@ -168,7 +168,7 @@ class MyProvider implements 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 `initialize` function is an ideal place for such logic. The `initialize` function may be renamed in accordance with language idioms. ```java // MyProvider implementation of the initialize function defined in Provider From bf7892fadb71891d738cb0c4fe95bd97caff39cf Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Thu, 8 Feb 2024 12:57:36 -0500 Subject: [PATCH 2/3] Update specification/sections/02-providers.md Co-authored-by: Todd Baert Signed-off-by: Max VelDink --- specification/sections/02-providers.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/sections/02-providers.md b/specification/sections/02-providers.md index 5098d77e..9b5f3c92 100644 --- a/specification/sections/02-providers.md +++ b/specification/sections/02-providers.md @@ -168,7 +168,8 @@ class MyProvider implements 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 `initialize` function is an ideal place for such logic. The `initialize` function may be renamed in accordance with language idioms. +The `initialize` function is an ideal place for such logic. +The `initialize` function is named in accordance with language idioms. ```java // MyProvider implementation of the initialize function defined in Provider From 1a7cf98ff38faf17ce5cc1e6a3f22b53ca01a179 Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Fri, 9 Feb 2024 06:46:17 -0500 Subject: [PATCH 3/3] docs: update provider requirement 2.4.1 Signed-off-by: Max VelDink --- specification.json | 2 +- specification/sections/02-providers.md | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/specification.json b/specification.json index 341e4200..eb3ed089 100644 --- a/specification.json +++ b/specification.json @@ -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": [] }, diff --git a/specification/sections/02-providers.md b/specification/sections/02-providers.md index 9b5f3c92..0ff71b0d 100644 --- a/specification/sections/02-providers.md +++ b/specification/sections/02-providers.md @@ -121,7 +121,7 @@ ResolutionDetails 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 @@ -164,12 +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 `initialize` function is an ideal place for such logic. -The `initialize` function is named in accordance with language idioms. +The initialization function is an ideal place for such logic. ```java // MyProvider implementation of the initialize function defined in Provider @@ -282,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 } //... @@ -291,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. \ No newline at end of file +Alternatively, implementations might leverage language idioms such as auto-disposable interfaces or some means of cancellation signal propagation to allow for graceful shutdown.