pltbkd commented on code in PR #938:
URL: https://github.com/apache/flink-agents/pull/938#discussion_r3855636560


##########
runtime/src/main/java/org/apache/flink/agents/runtime/subagent/BaseAsyncSubagentSetup.java:
##########
@@ -0,0 +1,287 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.runtime.subagent;
+
+import org.apache.flink.agents.api.context.DurableCallable;
+import org.apache.flink.agents.api.context.RunnerContext;
+import org.apache.flink.agents.api.resource.ResourceContext;
+import org.apache.flink.agents.api.resource.ResourceDescriptor;
+import org.apache.flink.agents.api.subagent.SubagentFuture;
+import org.apache.flink.agents.api.subagent.SubagentResult;
+
+import javax.annotation.Nullable;
+
+import java.util.concurrent.Callable;
+
+/**
+ * Production base for sub-agents whose protocol is an asynchronous job, run 
in durable pub/sub
+ * mode: {@code submit} publishes the run through one durable POST, the 
returned handle subscribes
+ * to it.
+ */
+public abstract class BaseAsyncSubagentSetup extends BaseSubagentSetup {
+
+    /**
+     * Delay between status probes while waiting for the run to reach a 
terminal state. Defaults to
+     * {@code 500}. The descriptor-based constructor reads the optional {@code
+     * statusPollIntervalMillis} argument over it, and subclasses may override 
it directly.
+     */
+    protected long statusPollIntervalMillis = 500;
+
+    protected BaseAsyncSubagentSetup() {}
+
+    /**
+     * Descriptor-based construction, as used by YAML-declared {@code 
subagents:} entries: reads the
+     * optional {@code statusPollIntervalMillis} argument, falling back to the 
default of {@code
+     * 500} when absent.
+     */
+    protected BaseAsyncSubagentSetup(
+            ResourceDescriptor descriptor, ResourceContext resourceContext) {
+        Number statusPollInterval = 
descriptor.getArgument("statusPollIntervalMillis");

Review Comment:
   I noticed the descriptor arguments are mostly snake_case, so I'll align the 
naming to status_poll_interval_millis on both sides (dropping the camelCase 
alias on the Python side). Tests for the descriptor argument and the 
construction path will be added as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to