Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I'm creating this pull request not so much for you to merge, but for discuss it, or discuss other options.
I think I may be stretching the limits of CLOG a bit, and so I need something like this. Or I'm wrong, and there's an alternative way of doing what I need with current CLOG already.
The issue is with the integration of some javascript components, where I need to execute some arbitrary javascript on the client, following some particular JS api, and at the same time bind some function server side.
So, I cannot use set-event family functions, I need to follow an api. And also I need to access arbitrary data sent from client side (and the data may be had to be extracted right from the client side event).
So I came up with this implementation of callbacks. Callback functions are defined via defcallback and then invoked from javascript via call-callback (call-callback actually generates the javascript needed to call the callback function).
For example, this is how I'm using it for a graph component I'm trying to integrate:
Define a callback function.
args
is an arbitrary json object sent from the client:Generate js code following a js component api that calls the server-side callback and sends arbitrary js arguments to it:
Unfortunately the implementation needs to touch
clog-connection::handle-message
.But let's discuss if possible.
Thank you.