@@ -46,7 +46,7 @@ func newBroadcastServer(serverOpts *serverOptions) *broadcastServer {
4646 logger : serverOpts .logger ,
4747 machineID : serverOpts .machineID ,
4848 }
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 ... )
5050 srv .manager .AddAddr (srv .id , serverOpts .listenAddr , srv .machineID )
5151 return srv
5252}
@@ -112,30 +112,41 @@ func NewBroadcastOrchestrator(srv *Server) *BroadcastOrchestrator {
112112
113113type BroadcastOption func (* broadcast.BroadcastOptions )
114114
115+ // WithSubset enables broadcasting to a subset of the servers in the view.
116+ // It has the same function as broadcast.To().
115117func WithSubset (srvAddrs ... string ) BroadcastOption {
116118 return func (b * broadcast.BroadcastOptions ) {
117119 b .ServerAddresses = srvAddrs
118120 }
119121}
120122
123+ // WithoutSelf prevents the server from broadcasting to itself.
121124func WithoutSelf () BroadcastOption {
122125 return func (b * broadcast.BroadcastOptions ) {
123126 b .SkipSelf = true
124127 }
125128}
126129
130+ // ProgressTo allows the server to accept messages to the given method.
131+ // Should only be used if the ServerOption WithOrder() is used.
127132func ProgressTo (method string ) BroadcastOption {
128133 return func (b * broadcast.BroadcastOptions ) {
129134 b .ProgressTo = method
130135 }
131136}
132137
138+ // AllowDuplication allows the server to broadcast more than once
139+ // to the same RPC method for a particular broadcast request.
133140func AllowDuplication () BroadcastOption {
134141 return func (b * broadcast.BroadcastOptions ) {
135142 b .AllowDuplication = true
136143 }
137144}
138145
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.
139150func WithRelationToRequest (broadcastID uint64 ) BroadcastOption {
140151 return func (b * broadcast.BroadcastOptions ) {
141152 b .RelatedToReq = broadcastID
0 commit comments