question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate support for return value bindings

See original GitHub issue

Investigate whether we can simplify function signatures in cases where there is only a single ouput binding. Currently we require an output parameter. In such cases, it would be more natural to simply map the single output binding to the return value of the function.

Note that we already support this as a special case for HttpTrigger. We should investigate whether we can generalize that. In function.json since return values aren’t named in function signatures, we’d have to use a special name like “$return” or something. We also need to think through what this means for script languages like BAT where there is no “return value” for the function.

This would require core SDK changes to support return value attribute binding. E.g.:

[return: Blob("test", FileAccess.Write)]
public static string Test(
    [QueueTrigger("test")] string message)
{
    return "Testing";
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
mathewccommented, Sep 14, 2016

FYI: I’m prototyping this now. Basically I’m thinking we can just handle a “$return” output binding specially in our function generation. We map it to normal SDK “out” binding, and simply copy the return value into that out binding after invoking the users function. Meaning we wouldn’t actually have to add this to core SDK, where I don’t think there is much demand for it anyways.

1reaction
mathewccommented, Sep 15, 2016

Guys, take a look at the PR for this referenced above. You can see some example functions in the samples/tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Knockout - Unable to process binding
It will display what that element is being bound to which is usually sufficient to help you get your head around what the...
Read more >
Investigate passing a parameter through a binding #1080
Investigate passing a parameter through a binding #1080 ... We do support using the value from one binding for another. See this example,....
Read more >
XAML data binding diagnostics - Visual Studio (Windows)
Use new tools in Visual Studio to detect and resolve data binding errors in XAML projects.
Read more >
Java Bindings Metadata - Xamarin
We're currently investigating custom binding usage on the Xamarin ... NET namespaces, rename a class, or change the return type of a method....
Read more >
Solving Customer Problems: Returns, Refunds, and Other ...
Return to the Store or Website. Explain the problem. Is the product faulty? Damaged? Did you get poor service or repairs that didn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found