added example service

This commit is contained in:
2023-05-29 21:49:41 +02:00
parent 0c9f186d8a
commit 9b10ff1d14
2 changed files with 26 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
package bin;
import kernel.log.Log;
import kernel.Timer;
import kernel.ps.ProcessHandle;
import kernel.ps.Process;
class HelloWorldService implements Process {
public function new() {}
public function run(handle:ProcessHandle) {
Log.debug("HelloWorldService started");
handle.write("Hello World! Started\n");
this.startTimer(handle);
}
public function startTimer(handle: ProcessHandle) {
new Timer(1000, function() {
handle.write("Hello World!\n");
this.startTimer(handle);
});
}
}