I am in the process of developing a library that will be written in Go and compiled down to a C shared library
so it can be called by languages such as Python
, Node.JS
, Java
and Ruby
I have just realised that there will be an issue when it comes to callbacks. How can I callback into the calling code which will be at least one of the above languages? Is there a single way I can do it or will I need to implement something specific on the Go side for each language?
Update for clarity:
I am already able to build Go as a library and execute the code from other languages such as Java and Python.
My question specifically relates to a situation where go is running something asynchronously and needs to call back into the caller (i.e. Java, Python).