IAudience Interface
Represents all clients connected to the op stream, both read-only and read/write.
Signature
export interface IAudience extends IEventProvider<IAudienceEvents>
Extends: IEventProvider<IAudienceEvents>
Remarks
Access to the Audience when a container is disconnected is a tricky subject. See the remarks on specific methods for more details.
Methods
Method | Return Type | Description |
---|---|---|
getMember(clientId) | IClient | undefined | Get details about the connected client with the specified clientId, or undefined if the specified client isn't connected. |
getMembers() | Map<string, IClient> | List all clients connected to the op stream, keyed off their clientId. |
getSelf() | ISelf | undefined | Returns information about client's connection. Please see ISelf member descriptions for more details. undefined if this client has never connected to the ordering service. Please see clientId for more details on when values returned by this function change over time. |
Method Details
getMember
Get details about the connected client with the specified clientId, or undefined if the specified client isn't connected.
Signature
getMember(clientId: string): IClient | undefined;
Remarks
When the container is disconnected, there are no guarantees about the correctness of what this method returns. The default implementation in Fluid Framework continues to return members that were part of the audience when the container disconnected, but this could change in the future. Other implementations could decide to always return undefined, or only return an IClient when the local client is requested.
Note that the clientId that a disconnected container might see for itself is an old one. A disconnected container does not technically have a clientId tied to an active connection to the service.
Parameters
Parameter | Type | Description |
---|---|---|
clientId | string |
Returns
Return type: IClient | undefined
getMembers
List all clients connected to the op stream, keyed off their clientId.
Signature
getMembers(): Map<string, IClient>;
Remarks
When the container is disconnected, there are no guarantees about the correctness of what this method returns. The default implementation in Fluid Framework continues to return the list of members as it last saw it before the container disconnected, but this could change in the future. Other implementations could decide to return an empty list, or a list that only includes the local client.
Note that the clientId that a disconnected container might see for itself is an old one. A disconnected container does not technically have a clientId tied to an active connection to the service.
Returns
Return type: Map<string, IClient>