refactor(tracker): get rid of execChan, use broker.ToModel instead

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-11-02 23:44:52 +02:00
parent 76322bb541
commit 37769fcc9c
2 changed files with 7 additions and 14 deletions

View File

@ -133,17 +133,17 @@ func init() {
}
},
CloseFunc: func() {
t.Exec() <- func() { t.ForceQuit().Do() }
broker.ToModel <- tracker.MsgToModel{Data: func() { t.ForceQuit().Do() }}
t.WaitQuitted()
detector.Close()
},
GetChunkFunc: func(isPreset bool) []byte {
retChn := make(chan []byte)
t.Exec() <- func() { retChn <- t.MarshalRecovery() }
broker.ToModel <- tracker.MsgToModel{Data: func() { retChn <- t.MarshalRecovery() }}
return <-retChn
},
SetChunkFunc: func(data []byte, isPreset bool) {
t.Exec() <- func() { t.UnmarshalRecovery(data) }
broker.ToModel <- tracker.MsgToModel{Data: func() { t.UnmarshalRecovery(data) }}
},
}