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

When embedding C++ code provide a possibility to execute the client call asynchronously #23

Open
bheisen opened this issue Jan 12, 2021 · 0 comments
Labels
feature New feature or request

Comments

@bheisen
Copy link
Collaborator

bheisen commented Jan 12, 2021

Is your feature request related to a problem? Please describe.
When VRPC is used to embed C/C++ libraries to be called by e.g. a local Node.js client and the embedded C++ functions are of synchronous (blocking) nature, users typically encounter a problem. Those function calls when executed by the (local) VRPC client will block the main thread and hence - in Node.js - the main event-loop. This is a performance killer for the rest of the client application. Today, users must workaround themselves by wrapping those calls into threads which ship their data back onto the clients' application event-loop (libuv in case of Node.js).

Describe the solution you'd like
VRPC should provide a simple option that - when enabled - automatically executes (selected or all?) functions asynchronously, obsoleting the need for the user to implement any additional threading code. Function that are bound this way should automatically manifest themselves as asynchronous functions (i.e. return a Promise) on the client as well and be executable with a simple await statement.

Describe alternatives you've considered
An alternative could be to use potentially available threading features of the client application on such functions.

Additional context
Most certainly such an enhancement must be done in the addon.cpp (Node.js) and module.cpp (Python3) files. The underlying technology should make use of a second event-loop - using the same technology as already implemented on the stand-alone C++ agents (i.e. asio and friends)

@bheisen bheisen added the feature New feature or request label Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant