Skip to content

Commit

Permalink
feat: NOT_READY after provider shutdown (#216)
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert authored Nov 28, 2023
1 parent 2973c53 commit 73922b2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,13 @@
"RFC 2119 keyword": "MAY",
"children": []
},
{
"id": "Requirement 2.5.2",
"machine_id": "requirement_2_5_2",
"content": "After a provider's shutdown function has terminated successfully, the provider's state MUST revert to its uninitialized state.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 2.6.1",
"machine_id": "requirement_2_6_1",
Expand Down
14 changes: 13 additions & 1 deletion specification/sections/02-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,15 @@ title: Provider State
stateDiagram-v2
direction LR
[*] --> NOT_READY
NOT_READY --> READY
NOT_READY --> READY:initialize
READY --> ERROR
ERROR --> READY
READY --> STALE
STALE --> READY
STALE --> ERROR
READY --> NOT_READY:shutdown
STALE --> NOT_READY:shutdown
ERROR --> NOT_READY:shutdown
```

see [provider status](../types.md#provider-status)
Expand Down Expand Up @@ -250,6 +253,15 @@ class MyProvider implements Provider, AutoDisposable {
}
```

#### Requirement 2.5.2

> After a provider's shutdown function has terminated successfully, the provider's state **MUST** revert to its uninitialized state.

If a provider requires initialization, once it's shut down, it must transition to its initial `NOT_READY` state. Some providers may allow reinitialization from this state.
Providers not requiring initialization are assumed to be ready at all times.
see: [initialization](#24-initialization)
### 2.6. Provider context reconciliation
[![experimental](https://img.shields.io/static/v1?label=Status&message=experimental&color=orange)](https://github.com/open-feature/spec/tree/main/specification#experimental)
Expand Down

0 comments on commit 73922b2

Please sign in to comment.