mdk_runtime.Functions Maven / Gradle / Ivy
/* Quark 1.0.452 run at 2016-11-10 18:39:58.222591 */
package mdk_runtime;
public class Functions {
static datawire_mdk_md.Root root = new datawire_mdk_md.Root();
/**
* On Python, log to a per-process file if MDK_LOG_MESSAGES env variable is set.
*/
public static void log_to_file(String s) {
if (!(((quark.os.Environment.getEnvironment()).__get__("MDK_LOG_MESSAGES"))==(null) || ((Object)((quark.os.Environment.getEnvironment()).__get__("MDK_LOG_MESSAGES")) != null && ((Object) ((quark.os.Environment.getEnvironment()).__get__("MDK_LOG_MESSAGES"))).equals(null)))) {
Object o = "";
}
}
/**
* Create a MDKRuntime with the default configuration and start its actors.
*/
public static MDKRuntime defaultRuntime() {
MDKRuntime runtime = new MDKRuntime();
((runtime).dependencies).registerService("envvar", new RealEnvVars());
QuarkRuntimeTime timeService = new QuarkRuntimeTime();
QuarkRuntimeWebSockets websockets = new QuarkRuntimeWebSockets();
((runtime).dependencies).registerService("time", timeService);
((runtime).dependencies).registerService("schedule", timeService);
((runtime).dependencies).registerService("websockets", websockets);
mdk_runtime.files.FileActor fileActor = new mdk_runtime.files.FileActorImpl(runtime);
((runtime).dependencies).registerService("files", fileActor);
((runtime).dispatcher).startActor(timeService);
((runtime).dispatcher).startActor(websockets);
((runtime).dispatcher).startActor(fileActor);
return runtime;
}
public static MDKRuntime fakeRuntime() {
MDKRuntime runtime = new MDKRuntime();
((runtime).dependencies).registerService("envvar", new FakeEnvVars());
FakeTime timeService = new FakeTime();
FakeWebSockets websockets = new FakeWebSockets();
((runtime).dependencies).registerService("time", timeService);
((runtime).dependencies).registerService("schedule", timeService);
((runtime).dependencies).registerService("websockets", websockets);
mdk_runtime.files.FileActor fileActor = new mdk_runtime.files.FileActorImpl(runtime);
((runtime).dependencies).registerService("files", fileActor);
((runtime).dispatcher).startActor(timeService);
((runtime).dispatcher).startActor(websockets);
((runtime).dispatcher).startActor(fileActor);
return runtime;
}
}