File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,18 +8,18 @@ import (
8
8
)
9
9
10
10
// MessageBatch allows a user to batch related messages and then publish them at
11
- // once. This allows the Scheduler to define an order for the outgoing RPCs.
11
+ // once. This allows the Scheduler to define an order for outgoing RPCs.
12
12
// This helps bandwidth constrained peers.
13
13
type MessageBatch struct {
14
14
Scheduler RPCScheduler
15
15
messages []* Message
16
16
}
17
17
18
- // RPCScheduler is the publishing strategy publishing a set of RPCs.
18
+ // RPCScheduler schedules outgoing RPCs.
19
19
type RPCScheduler interface {
20
- // AddRPC adds an RPC to the strategy .
20
+ // AddRPC adds an RPC to the scheduler .
21
21
AddRPC (peer peer.ID , msgID string , rpc * RPC )
22
- // All returns an ordered iterator of RPCs to publish .
22
+ // All returns an ordered iterator of RPCs.
23
23
All () iter.Seq2 [peer.ID , * RPC ]
24
24
}
25
25
Original file line number Diff line number Diff line change @@ -1390,15 +1390,15 @@ func (p *PubSub) PublishBatch(batch *MessageBatch) error {
1390
1390
return fmt .Errorf ("pubsub router is not a BatchPublisher" )
1391
1391
}
1392
1392
1393
- // Copy the batch to avoid the footgun of reusing strategy state across batches
1393
+ // Copy the batch to avoid the footgun of reusing scheduler state across batches
1394
1394
var copy MessageBatch
1395
1395
copy .Scheduler = batch .Scheduler
1396
1396
copy .messages = batch .messages
1397
1397
batch .Scheduler = nil
1398
1398
batch .messages = nil
1399
1399
1400
1400
if copy .Scheduler == nil {
1401
- // Default to RarestFirstStrategy
1401
+ // Default to Rarest first
1402
1402
copy .Scheduler = & RarestFirstRPCScheduler {}
1403
1403
}
1404
1404
You can’t perform that action at this time.
0 commit comments