feature: export peer.TaskManager for embedding dragonfly in custom binary
@@ -56,6 +56,9 @@ import (
type PeerHost interface {
Serve() error
Stop()
+
+ // ExportTaskManager returns the underlay peer.TaskManager for downloading when embed dragonfly in custom binary
+ ExportTaskManager() peer.TaskManager
}
type peerHost struct {
@@ -419,3 +422,7 @@ func (ph *peerHost) Stop() {
}
})
}
+
+func (ph *peerHost) ExportTaskManager() peer.TaskManager {
+ return ph.PeerTaskManager
+}
