Skip to content
Snippets Groups Projects
Commit 63e5de49 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Add NDF thread with initial (failing) test for feedback

parent d26ec3d9
No related branches found
No related tags found
No related merge requests found
......@@ -16,13 +16,14 @@ import (
"gitlab.com/elixxir/notifications-bot/io"
"gitlab.com/xx_network/comms/connect"
//"gitlab.com/elixxir/comms/notificationBot"
"time"
"bytes"
"gitlab.com/elixxir/crypto/hash"
"time"
)
// Stopper function that stops the thread on a timeout
type Stopper func(timeout time.Duration) bool
// GatewaysChanged function processes the gateways changed event when detected
// in the NDF
type GatewaysChanged func(ndf pb.NDF)
......@@ -34,7 +35,6 @@ type InstanceObject interface {
GetPermHost() *connect.Host
}
// TrackNdf kicks off the ndf tracking thread
func TrackNdf(i InstanceObject) Stopper {
// Handler function for the gateways changed event
......@@ -64,7 +64,6 @@ func TrackNdf(i InstanceObject) Stopper {
return quitFn
}
func trackNdf(poller io.PollingConn, quitCh chan bool, gwEvt GatewaysChanged) {
lastNdfHash := make([]byte, 32)
pollDelay := 1 * time.Second
......
......@@ -8,17 +8,17 @@
package notifications
import (
"testing"
pb "gitlab.com/elixxir/comms/mixmessages"
"sync"
"testing"
"time"
)
type MockPoller struct {
ndf *pb.NDF
sync.Mutex
}
func (m MockPoller) PollNdf() (*pb.NDF, error) {
m.Lock()
defer m.Unlock()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment