Skip to content

Commit

Permalink
Merge branch 'main' into improvement/client-stale-events
Browse files Browse the repository at this point in the history
  • Loading branch information
beeme1mr authored Aug 22, 2023
2 parents fc64a1c + cd42c52 commit d381e6c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"markdown-link-check": "^3.10.2",
"markdown-toc": "^1.2.0",
"markdownlint-cli": "^0.35.0",
"prettier": "^2.6.2"
"prettier": "^3.0.0"
}
}
7 changes: 7 additions & 0 deletions specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@
"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
18 changes: 18 additions & 0 deletions specification/sections/01-flag-evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,24 @@ 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

0 comments on commit d381e6c

Please sign in to comment.