From 2c36abdc542b3c0ce25a3446a2c80ff6f91aa1e3 Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Fri, 9 Feb 2024 16:41:25 -0500 Subject: [PATCH] docs: add language-specific initialize naming (#244) Signed-off-by: Max VelDink Co-authored-by: Todd Baert --- specification.json | 2 +- specification/sections/02-providers.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 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 46a29dd5..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,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 @@ -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 } //... @@ -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. \ 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.