-
Using Coroutines
Hey guys I'm in need of a little help here with using coroutines. I can find very little information on them on the internet.
How are they constructed? I have seen on the internet that they are defined as such.
Coroutine(java.lang.string producer, int x){
}
but when I do this it looks for a return type like a method.
I have also seen this.
Coroutine Producer=new Coroutine (int x, double y);
But this comes up as not recognized.
Also do I have to import a package to work with these coroutines? If so what is the package.
How would I pause one coroutine while I start another?
I know those are a lot of questions but I very much appreciate the help.
-
Please excuse my ignorance, but what exactly is a "Coroutine"? Is this part of standard Java? Part of a separate library? Please clarify this for the uninitiated.
-
A coroutine is basically a subroutine that allows multiple entry points, you don't have to start it at the beginning every time.
I am not sure if it is part of standard java or if it has to be imported. My professor will not help me at all.
-
Again, I don't know, but perhaps someone smarter than I can help out here. I thought that I've at least heard about all components of basic java even if I'm no expert in them, and I've never heard of this. Sorry I couldn't help more, but again, hopefully someone else will. Meanwhile, if you find any more information on this, please post it here.
Best of luck.
-
Coroutines ?
OK, coroutines don't exist in the basic Java libraries as an API (concept of subroutines doesn't exist either in Java... they're all methods). It has to be a third party library (which has to be imported) or a plugin. The only time have had to work with subroutines was with assembler or basic.
Luck,
CJSL