@@ -46,7 +46,7 @@ func newBroadcastServer(serverOpts *serverOptions) *broadcastServer {
46
46
logger : serverOpts .logger ,
47
47
machineID : serverOpts .machineID ,
48
48
}
49
- srv .manager = broadcast .NewBroadcastManager (serverOpts .logger , createClient , srv .canceler , serverOpts .executionOrder , serverOpts .clientDialTimeout , serverOpts .reqTTL , serverOpts .shardBuffer , serverOpts .sendBuffer )
49
+ srv .manager = broadcast .NewBroadcastManager (serverOpts .logger , createClient , srv .canceler , serverOpts .executionOrder , serverOpts .clientDialTimeout , serverOpts .reqTTL , serverOpts .shardBuffer , serverOpts .sendBuffer , serverOpts . grpcDialOpts ... )
50
50
srv .manager .AddAddr (srv .id , serverOpts .listenAddr , srv .machineID )
51
51
return srv
52
52
}
@@ -112,30 +112,41 @@ func NewBroadcastOrchestrator(srv *Server) *BroadcastOrchestrator {
112
112
113
113
type BroadcastOption func (* broadcast.BroadcastOptions )
114
114
115
+ // WithSubset enables broadcasting to a subset of the servers in the view.
116
+ // It has the same function as broadcast.To().
115
117
func WithSubset (srvAddrs ... string ) BroadcastOption {
116
118
return func (b * broadcast.BroadcastOptions ) {
117
119
b .ServerAddresses = srvAddrs
118
120
}
119
121
}
120
122
123
+ // WithoutSelf prevents the server from broadcasting to itself.
121
124
func WithoutSelf () BroadcastOption {
122
125
return func (b * broadcast.BroadcastOptions ) {
123
126
b .SkipSelf = true
124
127
}
125
128
}
126
129
130
+ // ProgressTo allows the server to accept messages to the given method.
131
+ // Should only be used if the ServerOption WithOrder() is used.
127
132
func ProgressTo (method string ) BroadcastOption {
128
133
return func (b * broadcast.BroadcastOptions ) {
129
134
b .ProgressTo = method
130
135
}
131
136
}
132
137
138
+ // AllowDuplication allows the server to broadcast more than once
139
+ // to the same RPC method for a particular broadcast request.
133
140
func AllowDuplication () BroadcastOption {
134
141
return func (b * broadcast.BroadcastOptions ) {
135
142
b .AllowDuplication = true
136
143
}
137
144
}
138
145
146
+ // WithRelationToRequest allows for broadcasting outside a
147
+ // server handler related to a specific broadcastID.
148
+ // It is not recommended to use this method. Use the broadcast
149
+ // struct provided with a broadcast request instead.
139
150
func WithRelationToRequest (broadcastID uint64 ) BroadcastOption {
140
151
return func (b * broadcast.BroadcastOptions ) {
141
152
b .RelatedToReq = broadcastID
0 commit comments