Comments (6)
Code: internal void Step()
{
try
{
ExecutionEnded = !executor.MoveNext();
if(ExecutionEnded)
{
executor.Reset();
executor.MoveNext();
}
}
catch(Exception ex)
{
SYS32.KernelPanic(ex, "Coroutine");
}
}
from cosmos-coroutines.
from cosmos-coroutines.
It looks like you're inheriting a class from Coroutine
. You shouldn't really do that - what are you trying to achieve?
from cosmos-coroutines.
i'm trying to make repetative tasks
from cosmos-coroutines.
What do you mean by "repetitive tasks"? If you simply want to start multiple coroutines that run in infinite loops, please refer to the README file. Here's an example:
var coroutine = new Coroutine(MyCoroutine1());
coroutine.Start(); // will run the coroutine on the main pool; to run it in another, use CoroutinePool.AddCoroutine
// ...
IEnumerator<CoroutineControlPoint> MyCoroutine1()
{
while(true) {
Console.WriteLine("This prints every second.");
yield return WaitFor.Seconds(1);
}
}
More details are in the README file. Please be sure to yield return
in order to return control back to the scheduler. You shouldn't inherit any class other than CoroutineControlPoint
.
from cosmos-coroutines.
oh thanks
from cosmos-coroutines.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cosmos-coroutines.