Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move 1.1.8 content to 1.1.2.4 #225

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 1.1.2.4",
"machine_id": "requirement_1_1_2_4",
"content": "The `API` SHOULD provide functions to set a provider and wait for the `initialize` function to return or throw.",
"RFC 2119 keyword": "SHOULD",
"children": []
},
{
"id": "Requirement 1.1.3",
"machine_id": "requirement_1_1_3",
Expand Down Expand Up @@ -63,13 +70,6 @@
"RFC 2119 keyword": "MUST NOT",
"children": []
},
{
"id": "Requirement 1.1.8",
"machine_id": "requirement_1_1_8",
"content": "The `API` SHOULD provide functions to set a provider and wait for the `initialize` function to return or throw.",
"RFC 2119 keyword": "SHOULD",
"children": []
},
{
"id": "Requirement 1.2.1",
"machine_id": "requirement_1_2_1",
Expand Down
36 changes: 18 additions & 18 deletions specification/sections/01-flag-evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ Provider instances which are bound to multiple names won't be shut down until th

see: [shutdown](./02-providers.md#25-shutdown), [setting a provider](#setting-a-provider)

#### Requirement 1.1.2.4

> The `API` **SHOULD** provide functions to set a provider and wait for the `initialize` function to return or throw.

This function not only sets the provider, but ensures that the provider is ready (or in error) before returning or settling.

```java
// default client
OpenFeatureAPI.getInstance().setProviderAndWait(myprovider); // this method blocks until the provider is ready or in error
Client client = OpenFeatureAPI.getInstance().getClient();

// named client
OpenFeatureAPI.getInstance().setProviderAndWait('client-name', myprovider); // this method blocks until the provider is ready or in error
Client client = OpenFeatureAPI.getInstance().getClient('client-name');
```

Though it's possible to use [events](./05-events.md) to await provider readiness, such functions can make things simpler for `application authors` and `integrators`.

#### Requirement 1.1.3

> The `API` **MUST** provide a function to bind a given `provider` to one or more client `name`s. If the client-name already has a bound provider, it is overwritten with the new mapping.
Expand Down Expand Up @@ -112,24 +130,6 @@ See [setting a provider](#setting-a-provider) for details.

Clients may be created in critical code paths, and even per-request in server-side HTTP contexts. Therefore, in keeping with the principle that OpenFeature should never cause abnormal execution of the first party application, this function should never throw. Abnormal execution in initialization should instead occur during provider registration.

#### Requirement 1.1.8

> The `API` **SHOULD** provide functions to set a provider and wait for the `initialize` function to return or throw.

This function not only sets the provider, but ensures that the provider is ready (or in error) before returning or settling.

```java
// default client
OpenFeatureAPI.getInstance().setProviderAndWait(myprovider); // this method blocks until the provider is ready or in error
Client client = OpenFeatureAPI.getInstance().getClient();

// named client
OpenFeatureAPI.getInstance().setProviderAndWait('client-name', myprovider); // this method blocks until the provider is ready or in error
Client client = OpenFeatureAPI.getInstance().getClient('client-name');
```

Though it's possible to use [events](./05-events.md) to await provider readiness, such functions can make things simpler for `application authors` and `integrators`.

### 1.2. Client Usage

#### Requirement 1.2.1
Expand Down
Loading