Skip to content

Commit

Permalink
concurrent_tasks can be configured
Browse files Browse the repository at this point in the history
  • Loading branch information
milenkovicm committed Dec 9, 2024
1 parent 7a73948 commit d5abec4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,15 @@ pub struct PyExecutor {

#[pymethods]
impl PyExecutor {
#[pyo3(signature = (bind_port=None, bind_host =None, scheduler_host = None, scheduler_port = None))]
#[pyo3(signature = (bind_port=None, bind_host =None, scheduler_host = None, scheduler_port = None, concurrent_tasks = None))]
#[new]
pub fn new(
py: Python,
bind_port: Option<u16>,
bind_host: Option<String>,
scheduler_host: Option<String>,
scheduler_port: Option<u16>,
concurrent_tasks: Option<u16>,
) -> PyResult<Self> {
let mut config = ExecutorProcessConfig::default();
if let Some(port) = bind_port {
Expand All @@ -169,6 +170,10 @@ impl PyExecutor {
config.scheduler_host = host;
}

if let Some(concurrent_tasks) = concurrent_tasks {
config.concurrent_tasks = concurrent_tasks as usize
}

config.override_logical_codec = Some(Arc::new(PyLogicalCodec::try_new(py)?));
config.override_physical_codec = Some(Arc::new(PyPhysicalCodec::try_new(py)?));

Expand Down

0 comments on commit d5abec4

Please sign in to comment.