-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support an action that takes an asynchronous callback #7
Comments
Here's a hacked version of the
So when To repeat, I just hacked up whatever works, and I don't understand enough of the implications here to say whether this is a good idea. (For example, may it be better for performance to fire off calls to the action in parallel, or at least more in parallel than the above?) But it does the job, for me. |
@shreevatsa Thank you for this! I'll get it folded into pandoc-filter over the next few weeks, along with plan Promise and traditional callback support for those using older versions of node. |
When can you merge this? @mvhenderson |
Thanks for the reminder - I'll get to it in the next few days.
…Sent from my iPhone
On Jul 2, 2018, at 7:48 AM, Dennis ***@***.***> wrote:
When can you merge this? @mvhenderson
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@ds82 - Folded in code from @shreevatsa as *Async functions and published to NPM as v1.0.0. See README and the test/spec/async for example. Let me know if it works for you. Requires node with async/await support. |
I don't know enough about JavaScript to know whether this is the same issue as #1 (though I suspect it is), but let me describe it anyway :-)
All the examples end with
pandoc.stdio(action)
whereaction
is a function like:In my case, inside
action
I need to call a function that takes a callback (as is typical for Node):So I won't have something to return from inside
action
.I am right now trying to hack it out by copying and editing much of the internals of
pandoc-filter
.(Specifically,
stdio
which is an alias fortoJSONFilter
callsfilter
which callswalk
and it appears I need to hack a copy of that function: https://github.com/mvhenderson/pandoc-filter-node/blob/be9d69ac/index.js#L47,L79 .)But I imagine this is a common use case, and it would be better if
pandoc-filter
supported this.The text was updated successfully, but these errors were encountered: