yuluo-yx commented on code in PR #11:
URL:
https://github.com/apache/hertzbeat-collector-go/pull/11#discussion_r2330433451
##########
internal/collector/common/job/job_server.go:
##########
@@ -17,51 +17,191 @@
* under the License.
*/
-package transport
+package job
import (
"context"
+ "fmt"
+ "sync"
+
"hertzbeat.apache.org/hertzbeat-collector-go/internal/collector/common/collect"
+
"hertzbeat.apache.org/hertzbeat-collector-go/internal/collector/common/collect/dispatch"
+
"hertzbeat.apache.org/hertzbeat-collector-go/internal/collector/common/dispatcher"
clrServer
"hertzbeat.apache.org/hertzbeat-collector-go/internal/collector/common/server"
"hertzbeat.apache.org/hertzbeat-collector-go/internal/collector/common/types/collector"
+ jobtypes
"hertzbeat.apache.org/hertzbeat-collector-go/internal/collector/common/types/job"
)
+// TimeDispatcher interface defines time-based job scheduling
+type TimeDispatcher interface {
+ AddJob(job *jobtypes.Job) error
+ RemoveJob(jobID int64) error
+ Start(ctx context.Context) error
+ Stop() error
+}
+
+// Config represents job service configuration
type Config struct {
clrServer.Server
}
+// Runner implements the service runner interface
type Runner struct {
Config
+ timeDispatch TimeDispatcher
Review Comment:
这些配置应该都在 Config 中,config 是当前 server 的所有 ctx 配置,runner 只负责将当前 server run 起来
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]