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

Added toObjectAsync and toObjArrayAsync. #228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tonioss22
Copy link

These functions will not block the event loop compared to the original toObject function. They also return from a promise instead of a callback.
These functions are really useful when dealing with big data as return value. Performances are similar to the original method in terms of speed.

These functions will not block the event loop compared to the original toObject function. They also return from a promise instead of a callback. 
These functions are really useful when dealing with big data as return value. Performances are similar to the original method.
@tonioss22
Copy link
Author

I've added this since i have been looking for a way to unblock my event loop for a couple of days now, originally looking into worker threads but node-java does not support them yet (don't know if they ever will). This is a solution to that problem and i'm sure others would like to use it aswell.

@Tomas2D
Copy link

Tomas2D commented Mar 17, 2022

Can you please merge it? @jasonozias

@tonioss22
Copy link
Author

tonioss22 commented Mar 17, 2022

Can you please merge it? @jasonozias

Hey Tomas, you can still use the same idea but with a wrapper while waiting for this PR to be accepted. The solution i provided seem to slow down the event loop on bigger request, but it's still better then having it completely stop. I ended up running my biggest query with pyodbc in a worker node because i wanted faster results. But this may work quite well for your application. If you need any support, you can contact me via email.

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

Successfully merging this pull request may close these issues.

2 participants