Class AsyncExecutor
java.lang.Object
org.apache.opendal.NativeObject
org.apache.opendal.AsyncExecutor
- All Implemented Interfaces:
AutoCloseable
AsyncExecutor represents an underneath OpenDAL executor that runs async tasks spawned in the Rust world.
If the executor is passed to construct operators, the executor must outlive the operators.
Worker threads use the class loader that defines OpenDAL as their context class loader. Completion callbacks that change it must restore it before returning.
-
Field Summary
Fields inherited from class NativeObject
nativeHandle -
Method Summary
Modifier and TypeMethodDescriptionstatic AsyncExecutorcreateTokioExecutor(int cores) Create a Tokio executor with the specified number of worker threads.protected voiddisposeInternal(long handle) Deletes underlying native object pointer.Methods inherited from class NativeObject
close, isDisposed
-
Method Details
-
createTokioExecutor
Create a Tokio executor with the specified number of worker threads.- Parameters:
cores- the number of worker threads; must be positive- Returns:
- the executor
- Throws:
IllegalArgumentException- ifcoresis zero or negative
-
disposeInternal
protected void disposeInternal(long handle) Description copied from class:NativeObjectDeletes underlying native object pointer.- Specified by:
disposeInternalin classNativeObject- Parameters:
handle- to the native object pointer
-