Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling Output Bindings #52

Open
mcgear opened this issue Nov 19, 2023 · 2 comments
Open

Handling Output Bindings #52

mcgear opened this issue Nov 19, 2023 · 2 comments

Comments

@mcgear
Copy link

mcgear commented Nov 19, 2023

I tried following some related documentation elsewhere, but could not get the signalr output binding working. Can you please let me know how i should be setting outputs to get them working? Here is an example of what i am trying:
https://github.com/fathym-deno/iot-ensemble-device-data/blob/integration/functions/deviceTelemetry.ts

@mcgear
Copy link
Author

mcgear commented Nov 20, 2023

I went through the code, and based on lines 173-177 of mod.ts in the AzureFunctionsWorker definition, it seems like the following code should do the trick:

async function handler(context: AzureFunctionsContext) {
  context.log(`Telemetry item received: ${context.bindings.deviceTelemetry}`);
  // context.log(JSON.parse(context.bindings.deviceTelemetry));

  context.bindings!.signalRMessages = [
    {
      target: 'telemetry',
      arguments: [JSON.parse(context.bindings.deviceTelemetry)],
    },
  ];

However, non of my signalR listeners are working.

@mcgear
Copy link
Author

mcgear commented Nov 30, 2023

Any thoughts on this? am i doing it right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant