Skip to content

Commit b3681b2

Browse files
[WebPubSub] Update readme to use consistent service description and introduction across all languages (Azure#25080)
* update readme to be consistent with service introduction * Avoid using client as it is a preserved term * Add a diagram to illustrate the architecture * Add WebPubSub README to exclude list 'Client' has a special meaning to the service, so we don't want to use the section header 'Authenticate the client' * Update sdk/webpubsub/Azure.Messaging.WebPubSub/README.md Co-authored-by: Mohit Chakraborty <[email protected]> * Update sdk/webpubsub/Azure.Messaging.WebPubSub/README.md Co-authored-by: Mohit Chakraborty <[email protected]> Co-authored-by: Mohit Chakraborty <[email protected]> Co-authored-by: Mohit Chakraborty <[email protected]>
1 parent d665380 commit b3681b2

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

eng/.docsettings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ known_content_issues:
177177
- ['sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/README.md', '#15423']
178178
- ['sdk/personalizer/README.md','azure-sdk-tools/issues/42']
179179
- ['sdk/personalizer/Azure.AI.Personalizer/README.md','azure-sdk-tools/issues/42']
180+
- ['sdk/webpubsub/Azure.Messaging.WebPubSub/README.md','azure-sdk-tools/issues/42']
180181

181182
# .net climbs upwards. placing these to prevent assigning readmes to the wrong project
182183
package_indexing_exclusion_list:

sdk/webpubsub/Azure.Messaging.WebPubSub/README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# Azure Web PubSub service client library for .NET
22

3-
[Azure Web PubSub Service](https://aka.ms/awps/doc) is a service that enables you to build real-time messaging web applications using WebSockets and the publish-subscribe pattern. Any platform supporting WebSocket APIs can connect to the service easily, e.g. web pages, mobile applications, edge devices, etc. The service manages the WebSocket connections for you and allows up to 100K **concurrent** connections. It provides powerful APIs for you to manage these clients and deliver real-time messages.
3+
[Azure Web PubSub Service](https://aka.ms/awps/doc) is an Azure-managed service that helps developers easily build web applications with real-time features and publish-subscribe pattern. Any scenario that requires real-time publish-subscribe messaging between server and clients or among clients can use Azure Web PubSub service. Traditional real-time features that often require polling from server or submitting HTTP requests can also use Azure Web PubSub service.
44

5-
Any scenario that requires real-time publish-subscribe messaging between server and clients or among clients, can use Azure Web PubSub service. Traditional real-time features that often require polling from server or submitting HTTP requests, can also use Azure Web PubSub service.
5+
You can use this library in your app server side to manage the WebSocket client connections, as shown in below diagram:
66

7-
This library can be used to do the following actions. Details about the terms used here are described in [Key concepts](#key-concepts) section.
7+
![overflow](https://user-images.githubusercontent.com/668244/140014067-25a00959-04dc-47e8-ac25-6957bd0a71ce.png)
88

9+
Use this library to:
910
- Send messages to hubs and groups.
1011
- Send messages to particular users and connections.
1112
- Organize users and connections into groups.
1213
- Close connections
1314
- Grant, revoke, and check permissions for an existing connection
1415

16+
Details about the terms used here are described in [Key concepts](#key-concepts) section.
17+
1518
[Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/webpubsub/Azure.Messaging.WebPubSub/src) |
1619
[Package](https://www.nuget.org/packages/Azure.Messaging.WebPubSub) |
1720
[API reference documentation](https://aka.ms/awps/sdk/csharp) |
@@ -33,11 +36,9 @@ dotnet add package Azure.Messaging.WebPubSub --prerelease
3336
- An [Azure subscription][azure_sub].
3437
- An existing Azure Web PubSub service instance.
3538

36-
### Authenticate the client
39+
### Create and authenticate a `WebPubSubServiceClient`
3740

38-
In order to interact with the service, you'll need to create an instance of the WebPubSubServiceClient class. To make this possible, you'll need the connection string or a key, which you can access in the Azure portal.
39-
40-
### Create a `WebPubSubServiceClient`
41+
In order to interact with the service, you'll need to create an instance of the `WebPubSubServiceClient` class. To make this possible, you'll need the connection string or a key, which you can access in the Azure portal.
4142

4243
```C# Snippet:WebPubSubAuthenticate
4344
var serviceClient = new WebPubSubServiceClient(new Uri(endpoint), "some_hub", new AzureKeyCredential(key));
@@ -47,23 +48,23 @@ var serviceClient = new WebPubSubServiceClient(new Uri(endpoint), "some_hub", ne
4748

4849
### Connection
4950

50-
Connections, represented by a connection id, represent an individual websocket connection to the Web PubSub service. Connection id is always unique.
51+
A connection, also known as a client or a client connection, represents an individual WebSocket connection connected to the Web PubSub service. When successfully connected, a unique connection ID is assigned to this connection by the Web PubSub service.
5152

5253
### Hub
5354

54-
Hub is a logical concept for a set of connections. Connections are always connected to a specific hub. Messages that are broadcast to the hub are dispatched to all connections to that hub. Hub can be used for different applications, different applications can share one Azure Web PubSub service by using different hub names.
55+
A hub is a logical concept for a set of client connections. Usually you use one hub for one purpose, for example, a chat hub, or a notification hub. When a client connection is created, it connects to a hub, and during its lifetime, it belongs to that hub. Different applications can share one Azure Web PubSub service by using different hub names.
5556

5657
### Group
5758

58-
Group allow broadcast messages to a subset of connections to the hub. You can add and remove users and connections as needed. A client can join multiple groups, and a group can contain multiple clients.
59+
A group is a subset of connections to the hub. You can add a client connection to a group, or remove the client connection from the group, anytime you want. For example, when a client joins a chat room, or when a client leaves the chat room, this chat room can be considered to be a group. A client can join multiple groups, and a group can contain multiple clients.
5960

6061
### User
6162

6263
Connections to Web PubSub can belong to one user. A user might have multiple connections, for example when a single user is connected across multiple devices or multiple browser tabs.
6364

6465
### Message
6566

66-
Using this library, you can send messages to the client connections. A message can either be string text, JSON or binary payload.
67+
When a client is connected, it can send messages to the upstream application, or receive messages from the upstream application, through the WebSocket connection.
6768

6869
## Examples
6970

@@ -107,7 +108,9 @@ You can also easily [enable console logging](https://github.com/Azure/azure-sdk-
107108

108109
Please take a look at the
109110
[samples][samples_ref]
110-
directory for detailed examples on how to use this library.
111+
directory for detailed examples on how to use this library.
112+
113+
You can also find [more samples here][awps_sample].
111114

112115
## Contributing
113116

@@ -126,3 +129,4 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.
126129

127130
[azure_sub]: https://azure.microsoft.com/free/dotnet/
128131
[samples_ref]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/webpubsub/Azure.Messaging.WebPubSub/tests/Samples/
132+
[awps_sample]: https://github.com/Azure/azure-webpubsub/tree/main/samples/csharp

0 commit comments

Comments
 (0)