You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-web-pubsub/socketio-serverless-function-binding.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -358,6 +358,7 @@ Function triggers for socket connect event.
358
358
359
359
```python
360
360
import azure.functions as func
361
+
from azure.functions.decorators.core import DataType
361
362
import json
362
363
app = func.FunctionApp()
363
364
@@ -370,6 +371,7 @@ Function triggers for socket connected event.
370
371
371
372
```python
372
373
import azure.functions as func
374
+
from azure.functions.decorators.core import DataType
373
375
import json
374
376
app = func.FunctionApp()
375
377
@@ -382,6 +384,7 @@ Function triggers for socket disconnected event.
382
384
383
385
```python
384
386
import azure.functions as func
387
+
from azure.functions.decorators.core import DataType
385
388
import json
386
389
app = func.FunctionApp()
387
390
@@ -394,6 +397,7 @@ Function triggers for normal messages from clients.
394
397
395
398
```python
396
399
import azure.functions as func
400
+
from azure.functions.decorators.core import DataType
397
401
import json
398
402
app = func.FunctionApp()
399
403
@@ -406,6 +410,7 @@ Function trigger for normal messages with callback.
406
410
407
411
```python
408
412
import azure.functions as func
413
+
from azure.functions.decorators.core import DataType
409
414
import json
410
415
app = func.FunctionApp()
411
416
@@ -414,17 +419,19 @@ def chat(sio: str) -> str:
414
419
return json.dumps({'ack': ["param1"]})
415
420
```
416
421
417
-
### Configuration
422
+
### Annotation
423
+
418
424
419
425
| Property | Description |
420
426
|---------|---------|
421
427
| arg_name | The variable name of the argument in function to represent the trigger binding. |
422
428
| type | Must be `socketiotrigger`|
423
429
| hub | The hub name that a client needs to connect to. |
424
-
| data_type | Must be `DataType.STRING.|
430
+
| data_type | Must be `DataType.STRING`|
425
431
| namespace | The namespace of the socket. Default: "/" |
426
432
| eventName | The event name that the function triggers for. Some event names are predefined: `connect` for socket connect event. `connected` for socket connected event. `disconnected` for socket disconnected event. And other events are defined by user and it need to match the event name sent by client side. |
0 commit comments