-
Notifications
You must be signed in to change notification settings - Fork 13
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
Supporting async functions in function map #11
Comments
I've had a look at your code structure and can already say what functions wile become Do you know if this would affect you're code negatively? (I would expect not, since I think the Functions affected according to first research:
|
Hi! Thank you for your issue. I definitely agree that async functions should be supported. As you suggested implementing that should just be a matter of adding async to a bunch of function declarations and a bunch of awaits to function calls. I don't think it would negatively impact other aspects of the code. The one concern I might have, is a loss of performance for mapping huge datasources (huge input files), as returning and awaiting lots of promises might affect performance. This would need to be tested. (even if it did affect performance, the difference is probably not be very noticable and so no reason to not support the feature). Nevertheless, I definitely want to support that. I should have the feature within a few days. If you do want to try it out yourself and submit a pull request, you are very welcome to do so, just message me again:) Thanks |
This is being worked on in PR #12 ,
|
published in v1.7.0 |
First of all: I'm glad RocketRML support functions (and I'm putting them to good use).
But, I have a case where I would need to use an async function (details under) and I've seen this is not (yet) supported.
To illustrate:
this is a literal coming from a function: "[object Promise]"
obviously not the expected output.
Why an async function:
My function can only give results if something is loaded from the internet, thus using some async magic.
Why I think this should be feasible (without looking at the actual code :) :
The library functions are already async:
await parser.parseFileLive(mapfile,inputFiles,options);
I was thinking about just placing
await
before the function executions,but I did not yet have a look at your actual code to see where this would happen and how much more work this would give.
And even more, if this is the desired path to go (using await).
The text was updated successfully, but these errors were encountered: