Azure / Azure/azure-functions-python-worker

[FeatureRequest] --WebPubSub class and UserEventResponse--

Offen
#1,473 1 Kommentar 0 Reaktionen 1 zugewiesene Person Beansprucht von @bhagyshricompany Auf GitHub ansehen
area:python-functions feature python-sdk
Vorherrschende Sprache
Python
Sterne
357
Forks
116
Ø Merge
32 Min.
Gemergte PRs (30 T.)
1

Beschreibung

I am looking at the documentation for Web PubSub and more precisely [Tutorial: Create a serverless real-time chat app with Azure Functions and Azure Web PubSub service](https://learn.microsoft.com/en-us/azure/azure-web-pubsub/quickstart-serverless?tabs=javascript-v4). There I want to contribute and to add example for Python, but I have 2 concerns. First is that there is no functionality like in Javascript and C# for returning direct response to the caller:

`module.exports = async function (context, data) {

context.bindings.actions = {
actionName: "sendToAll",
data: `[${context.bindingData.request.connectionContext.userId}] ${data}`,
dataType: context.bindingData.dataType,
};
// UserEventResponse directly return to caller
var response = {
data: "[SYSTEM] ack.",
dataType: "text",
};
return response;
};`

I think there is a good idea to add some class which supports the request from webPubSubTrigger and functionality to return the message to the caller.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.