Coroutines - A new coroutine library

Hi,

I’ve create a new Java coroutine library. You can find it at https://github.com/offbynull/coroutines. The next time you’re coding up something that could benefit from being written as a coroutine (e.g. AI logic), give it a try and file a bug report if you encounter any issues.

Usage information is available on the project page. It requires bytecode instrumentation, but both Maven and Ant plugins are provided to help ease the burden of using it.

I understand the concept and why this is different to threads. But can you expand more on

And provide some real world use cases? I don’t really get why this would useful for AI. I don’t want to diminish what you have done as it sounds pretty impressive but I suspect the reason Javaflow isn’t actively developed is because there isn’t a huge need for it and that might be the case with what you have too. But I encourage you to prove me wrong :slight_smile:

Whenever you would like to be able to do sleeps() in your AI behavior logic is when they become really useful, because you can! (well, simulate it)
Example: