vsilaev / tascalate-async-await

Async / Await asynchronous programming model for Java versions 1.8 - 23; similar to the functionality available in C# 5. The implementation is based on continuations for Java (see my other projects).
BSD 2-Clause "Simplified" License
104 stars 12 forks source link

Classloader stuff #10

Closed auriium2 closed 2 years ago

auriium2 commented 2 years ago

If i have a main project, compiled with async-await transformers, and another project loaded via main project's class loaders, does another project need to be compiled using async-await transformers too in order to be able to use async await features? Does it need it's own shaded copy of async-await or can main project share with it?

auriium2 commented 2 years ago

Also, how do scheduler and scheduler provider work? e.g. if i want some async method running in one executor and the next async to run in another

vsilaev commented 2 years ago

If i have a main project, compiled with async-await transformers, and another project loaded via main project's class loaders, does another project need to be compiled using async-await transformers too in order to be able to use async await features? Does it need it's own shaded copy of async-await or can main project share with it?

If both projects are using @async and alike stuff than you need:

  1. Both projects have a "compile" dependency on net.tascalate.async.runtime
  2. Each project uses maven build tools <artifactId>net.tascalate.async.tools.maven</artifactId> and <artifactId>net.tascalate.javaflow.tools.maven</artifactId> as described in README

If only one project has async features, then only this project uses build tools and a compile dependency on runtime. Others will get dependency to runtime transitively, and there is no inheritance of build tools.

vsilaev commented 2 years ago

Also, how do scheduler and scheduler provider work? e.g. if i want some async method running in one executor and the next async to run in another

Please open a separate issue and I will post different scenarios there and later collect all publications to docs.