mirror of
https://github.com/wassname/ray.git
synced 2026-07-01 05:07:50 +08:00
Java doc: "Starting Ray" page (#10062)
This commit is contained in:
@@ -37,7 +37,7 @@ public final class Ray extends RayCall {
|
||||
*
|
||||
* @param factory A factory that produces the runtime instance.
|
||||
*/
|
||||
public static synchronized void init(RayRuntimeFactory factory) {
|
||||
private static synchronized void init(RayRuntimeFactory factory) {
|
||||
if (runtime == null) {
|
||||
runtime = factory.createRayRuntime();
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(Ray::shutdown));
|
||||
@@ -54,6 +54,14 @@ public final class Ray extends RayCall {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if {@link #init} has been called yet.
|
||||
* @return True if {@link #init} has already been called and false otherwise.
|
||||
*/
|
||||
public static boolean isInitialized() {
|
||||
return runtime != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store an object in the object store.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user