konsoletyper / teavm

Compiles Java bytecode to JavaScript, WebAssembly and C
https://teavm.org
Apache License 2.0
2.55k stars 260 forks source link

Support for ConcurrentLinkedQueue #896

Open varunsingh87 opened 3 months ago

varunsingh87 commented 3 months ago

Is there a plan to support the ConcurrentLinkedQueue class in the future? Perhaps something like this npm package.

ConcurrentLinkedQueue is the only class that makes teavm incompatible with socket.io. Other websocket libraries have many other Java classes that are not emulated by teavm.

konsoletyper commented 3 months ago

There's a plan to support ConcurrentLinkedQueue eventually, but there are no terms for that. I believe, this is an important feature for actual or potential TeaVM users, but there are plenty of such features, and I'm trying to guess (according to my own experience and feedback) what is more important right now. So if you really need ConcurrentLinkedQueue implementation and this is a show-stopper, you can try to motivate me to change my plans. You can try to convince me, that you are determined to create socket.io port for TeaVM and that this is going to make a lot of buzz around TeaVM and bring more users to it. Or you can become a sponsor. Anyway, my personal opinion that you don't need socket.io client for Java ported to JavaScript, because it was not written for this target with its specifics. I suggest that you write a socket.io TeaVM client, without the need in ConcurrentLinkedQueue and threads at all (just rely on JS event queue).

varunsingh87 commented 3 months ago

I appreciate your quick response. I may write a socketio-teavm JavaScript-Java wrapper as a workaround for this issue. If ConcurrentLinkedQueue works with socket.io, teavm becomes applicable to real-time multiplayer games and many other applications that use websockets. I would contribute this feature to teavm, but I don’t know have any knowledge of networking or compilers.