feat: implement token-based auto stream pulling
This commit is contained in:
@@ -21,8 +21,8 @@ func main() {
|
||||
flag.Parse()
|
||||
|
||||
cfg := config.Load(*cfgPath)
|
||||
log.Printf("edge-agent start id=%s uuid=%s cloud=%s mqtt=%s",
|
||||
cfg.EdgeID, cfg.GetDeviceIdentity(), cfg.CloudURL, cfg.MqttBroker)
|
||||
log.Printf("edge-agent start id=%s uuid=%s cloud=%s mqtt=%s auto_pull=%v",
|
||||
cfg.EdgeID, cfg.GetDeviceIdentity(), cfg.CloudURL, cfg.MqttBroker, cfg.AutoPull)
|
||||
|
||||
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||
defer cancel()
|
||||
@@ -43,8 +43,17 @@ func main() {
|
||||
mqttMgr := control.NewMqttManager(cfg)
|
||||
run(mqttMgr.Run)
|
||||
|
||||
// 1.5 Stream Puller (Optional: Dynamic URL fetching)
|
||||
var puller *stream.Puller
|
||||
if cfg.AutoPull {
|
||||
puller = stream.NewPuller(cfg)
|
||||
puller.StartHeartbeatLoop()
|
||||
defer puller.Stop()
|
||||
log.Println("puller: auto-pull mode enabled")
|
||||
}
|
||||
|
||||
// 2. Stream Ingestion (Dynamic)
|
||||
run(stream.NewStreamManager(cfg, frames, mqttMgr.GetUpdates()).Run)
|
||||
run(stream.NewStreamManager(cfg, puller, frames, mqttMgr.GetUpdates()).Run)
|
||||
|
||||
// 3. Inference (Dynamic Workers)
|
||||
run(infer.NewClient(cfg, frames, events, mqttMgr.GetUpdates()).Run)
|
||||
|
||||
Reference in New Issue
Block a user