deephaven.server.executors¶
Support for running operations on JVM server threads, so that they can be given work from python. Initially, there are two executors, “serial” and “concurrent”. Any task that will take an exclusive UGP lock should use the serial executor, otherwise the concurrent executor should be used. In the future there may be a “fast” executor, for use when there is no chance of using either lock.
- has_executor(executor_name)[source]¶
Returns True if an executor exists with that name.
- Return type:
bool
- submit_task(executor_name, task)[source]¶
Submits a task to run on a named executor. If no such executor exists, raises KeyError. The provided task should take care to set up any execution context or liveness scope to ensure that the task runs as intended.
Typically, tasks should not block on other threads. Ensure tasks never block on other tasks submitted to the same executor.
- Parameters:
executor_name (str) – the name of the executor to submit the task to
task (Callable[[], None]) – the function to run on the named executor
- Raises:
KeyError if the executor name –
- Return type:
None