deephaven.server.executors

Support for running operations on JVM server threads, so that they can be given work from python. 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.

Both executors currently share one server thread, so tasks submitted to either one run one at a time, in the order they were submitted. Tasks submitted to “concurrent” do not run in parallel. A later version may give the executors separate thread pools, so don’t rely on this ordering.

executor_names()[source]

Returns: the List of known executor names

Return type:

list[str]

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 any executor. The executors share one thread, so a task that waits for another submitted task deadlocks, even when the two tasks were submitted to different executors.

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