Open bluca opened 7 years ago
It looks to me as though this is also a problem with ZLoop.
I'm not an expert in any of the tech involved here.
I think one valid approach would be:
I took a first pass at this approach (and started pointing out the places that look obviously broken) here: https://github.com/jimrthy/zproject/pull/1
I probably won't get another chance to look at this until next weekend, at the earliest.
Maybe someone who's more familiar with GSL can help push it further along?
Thanks for investigating I'll give it at try next week
Thank you!
@jimrthy I havn't forgotten this issue but I'm a bit short on time for time being.
I haven't forgotten either. Just also distracted by other things.
Could you take a look on https://github.com/diorcety/zproject/tree/x_java2 ?
python use ffi in order to handle the callbacks. I used jffi which is an Java implementation which allow to use java callback quickly. This is almost the same thing that python stuff
Neat, I'll have a look at it later, thanks
Am 12.02.2018 3:55 nachm. schrieb "Diorcet Yann" notifications@github.com:
python use ffi in order to handle the callbacks. I used jffi which is an Java implementation which allow to use java callback quickly. This is almost the same thing that python stuff
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zeromq/zproject/issues/776#issuecomment-364946330, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeGuiJ5IfS-49StUlazgLunPsbrx5Xbks5tUFDlgaJpZM4LY7dS .
I managed to write a pure java class for zactor, and doing this I also discovered zsys::create_pipe was not working for the same reason, it pass a pointer to a handle.
Found this link, but unable to see if really useful or not: https://stackoverflow.com/questions/819536/how-to-call-java-functions-from-c
(my 2 cents).
This problem really questions the usage of JNI for this project. Is it only here for historical reasons? Can more modern solutions allow us to build sturdier bindings for Java?
As of today, there are 4 ways to call C code from Java code:
More info: https://developer.okta.com/blog/2022/04/08/state-of-ffi-java#java-native-interface-jni
For now, I'm toying around with JNA. Function pointers as parameters are easy to use. What else should I try? What functions of zmq have limited usage in Java atm?
https://github.com/zeromq/zproject/blob/master/zproject_java_lib.gsl#L156
So the class is skipped given the constructor can't be generated.
This is a problem in CZMQ since it means that zactor bindings can't be generated. We'd need some help here from JNI experts! How can we fix this?
https://github.com/zeromq/czmq/issues/1443