Skip to content

Commit

Permalink
feat(requestmanager): correct for notification refactor
Browse files Browse the repository at this point in the history
Resolve discripencies with new and old notification interfaces
  • Loading branch information
hannahhoward committed Dec 10, 2020
1 parent 4ac76cf commit d063643
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions requestmanager/requestmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,11 @@ func (r *reqSubscriber) OnNext(topic notifications.Topic, event notifications.Ev
func (r reqSubscriber) OnClose(topic notifications.Topic) {
}

const requestNetworkError = "request_network_error"

func (rm *RequestManager) sendRequest(p peer.ID, request gsmsg.GraphSyncRequest) {
sub := notifications.NewMappableSubscriber(&reqSubscriber{p, request, rm.networkErrorListeners}, notifications.IdentityTransform)
failNotifee := notifications.Notifee{Topic: messagequeue.Error, Subscriber: sub}
sub := notifications.NewTopicDataSubscriber(&reqSubscriber{p, request, rm.networkErrorListeners})
failNotifee := notifications.Notifee{Data: requestNetworkError, Subscriber: sub}
rm.peerHandler.SendRequest(p, request, failNotifee)
}

Expand Down

0 comments on commit d063643

Please sign in to comment.