Skip to content

Commit

Permalink
improvement: emit events on context changed
Browse files Browse the repository at this point in the history
Signed-off-by: BillLynch <llynch.bill@gmail.com>
  • Loading branch information
Billlynch authored and toddbaert committed Dec 8, 2023
1 parent 5ed6c0c commit 82a5f73
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
21 changes: 21 additions & 0 deletions specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,27 @@
"content": "Handlers attached after the provider is already in the associated state, MUST run immediately.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 5.3.4",
"machine_id": "requirement_5_3_4",
"content": "When the provider's `on context changed` is called, `PROVIDER_STALE` handlers MUST run.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 5.3.5",
"machine_id": "requirement_5_3_5",
"content": "If the provider's `on context changed` function terminates successfully, `PROVIDER_READY` handlers MUST run.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 5.3.6",
"machine_id": "requirement_5_3_6",
"content": "If the provider's `on context changed` function terminates abnormally, `PROVIDER_ERROR` handlers MUST run.",
"RFC 2119 keyword": "MUST",
"children": []
}
]
}
18 changes: 18 additions & 0 deletions specification/sections/05-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,21 @@ For instance, _application authors_ may attach readiness handlers to be confiden
If such handlers are attached after the provider underlying the client has already been initialized, they should run immediately.

See [provider initialization](./02-providers.md#24-initialization), [setting a provider](./01-flag-evaluation.md#setting-a-provider).

#### Requirement 5.3.4

> When the provider's `on context changed` is called, `PROVIDER_STALE` handlers **MUST** run.
See: [provider events](#51-provider-events), [`provider event types`](../types.md#provider-events)

#### Requirement 5.3.5

> If the provider's `on context changed` function terminates successfully, `PROVIDER_READY` handlers **MUST** run.
See: [provider events](#51-provider-events), [`provider event types`](../types.md#provider-events)

#### Requirement 5.3.6

> If the provider's `on context changed` function terminates abnormally, `PROVIDER_ERROR` handlers **MUST** run.
See: [provider events](#51-provider-events), [`provider event types`](../types.md#provider-events)

0 comments on commit 82a5f73

Please sign in to comment.