-
Notifications
You must be signed in to change notification settings - Fork 450
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
Figure out how to support In/Out bindings properly for non C# languages #49
Comments
I'd posit this is a language by language thing. It feels like, we have phases of language support:
C# is at 4 (and probably actually something a little more advanced). Node is at 2. Everything else is at 1. Some frameworks, like Batch, may not ever advance to later phases. For phase 1, we may just go with in/out bindings, we have 1 in and 1 out. It's up to the end user to enforce type consistency (or risk failure). Thoughts? |
Do we need this open? We now have some support here, with work left to do, but this issue doesn't capture that work anymore, I think. |
Let's leave it open until I have a chance to review where we're at and what remains to do. I'll then update the issue with the details. |
One issue we have still is that we don't have proper portal support for |
I probably need to understand better what the difference between in and inout is. It seems like we could put it under the "in" category in the portal. |
We're mapping our { in, out, inout } values to the corresponding values that the core SDK uses in its bindings. It uses the There may be changes we can make in the SDK for this, or perhaps restrict changes to Functions. Not sure yet. |
Interesting. I remember we had thought about inout way back in the initial designs for UX, etc. We should probably sync how to expose this properly. Maybe a "Blob Read Input", "Blob Read/Write Input" and a "Blob Write Output? |
Do we need to keep that concept/restriction in place? I was talking to @brettsam about that and we were trying to understand the value of ReadWrite binding types. Document DB exposes similar types that would work as in or out. Prior to the change we made, we were driving that off of the argument type, so we can make that decision when needed. Just wondering if this is a concept we need users to worry about. |
^ 👍 I'd rather limit the number of concepts we have, especially since the bindings concepts can be a bit abstract to grok in the first place. If we can prevent the user from having to think about this, I think that'd be ideal. |
Bindings do need a direction, which must be specified by the user. There are also use cases for inout bindings, as in the DocDB/Blob scenarios. So the fact that the user is specifying a direction means that in the case of an inout binding (a binding that in their code they are both reading from and writing to), neither "in" nor "out" really capture it - it's an "inout". I agree that we want to make this as simple for users as possible. Need to think on it more. |
Need a discussion about in, out, and inout. @christopheranderson, @fabiocav and @mathewc |
I discovered this issue last night when I was implementing support for "inout" My language worker is returning output data in the gRPC Unfortunately, "inout" Doing so would enable pretty clean code to process blobs in some way after being uploaded, without having to have a separate output binding: use azure_functions::bindings::BlobTrigger;
use azure_functions::func;
#[func]
#[binding(name = "trigger", path = "container/{filename}")]
pub fn modify_blob(trigger: &mut BlobTrigger) {
info!("Current contents of blob '{}': {:?}.", trigger.path, trigger.blob.as_str());
trigger.blob = "Blob was modified!".into();
} Side note: the |
Closing this issue as this work is being tracked as part of the rich binding support being added to the OOP language workers feature. |
Hi @fabiocav. Is there an issue that tracks that I could subscribe to? I like to keep track of what's going in so I can update the Rust worker as-needed. |
There are challenges currently to supporting in/out binding in scripts for types other than C#. The reason is that for all the other script types, values have to get marshalled (e.g. input bindings write to a temp file, output bindings read from temp file). That pipeline of course loses any object identity, which is required by the SDK read/write bindings.
The text was updated successfully, but these errors were encountered: