-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retry: Expose "self" in audience and switch container to project more…
… consistent states related to connections and changes of clientId (#20703) This change substantially simplifies programming model around managing connection and clientId changes. Key changes: 1. Add `self()` method in audience. 2. Add `"selfChanged"` event in audience. 3. Changes how connected / clientId are exposed to hosts & container runtime while container runtime is loading, if connection is established before container runtime is loaded. - in the past, we would expose connected state and clientId, but also would raise "connected" event once runtime was fully loaded. You see as result code in ContainerRuntime.setConnectionState() that calculates, and pivots based on changeOfState variable. - With this change, we delay telling the world that we are connected, until runtime is fully loaded. And only then raise event and change results of getSelf(). That way user code can be substantially simplified, where they do not need to care about missing connected events (if, for example, we were not doing that extra event), because we will promise to them (once this change propagates) that connections can materialize only after load, thus simplifying loading flows. ADO: https://dev.azure.com/fluidframework/internal/_workitems/edit/6364
- Loading branch information
Showing
22 changed files
with
437 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"@fluidframework/container-definitions": major | ||
"@fluidframework/container-loader": major | ||
"@fluidframework/container-runtime": major | ||
--- | ||
|
||
Audience & connection sequencing improvements | ||
|
||
Here are breaking changes in Audience behavior: | ||
1. IAudience no longer implements EventEmmiter. If you used addListener() or removeListener(), please replace with on() & off() respectively. | ||
2. IAudience interface implements getSelf() method and "selfChanged" event. | ||
3. IContainerContext.audience is no longer optional | ||
4. "connected" events are now raised (various API surfaces - IContainer, IContainerRuntime, IFluidDataStoreRuntime, etc.) a bit later in reconnection sequence for "read" connections - only after client receives its own "join" signal and caught up on ops, which makes it symmetrical with "write" connections. | ||
- If this change in behavior breaks some scenario, please let us know immediately, but you can revert that behavior using the following feature gates: | ||
- "Fluid.Container.DisableCatchUpBeforeDeclaringConnected" | ||
- "Fluid.Container.DisableJoinSignalWait" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.