@@ -94,6 +94,8 @@ pub struct ConnectionConfig {
94
94
pub batch_limit : usize ,
95
95
pub polling_interval : Duration ,
96
96
pub max_concurrent_requests : usize ,
97
+ pub max_signature_channel_size : Option < usize > ,
98
+ pub max_transaction_channel_size : Option < usize > ,
97
99
pub retry_config : RetryConfig ,
98
100
}
99
101
@@ -103,12 +105,16 @@ impl ConnectionConfig {
103
105
polling_interval : Duration ,
104
106
max_concurrent_requests : usize ,
105
107
retry_config : RetryConfig ,
108
+ max_signature_channel_size : Option < usize > , // None will default to 1000
109
+ max_transaction_channel_size : Option < usize > , // None will default to 1000
106
110
) -> Self {
107
111
ConnectionConfig {
108
112
batch_limit,
109
113
polling_interval,
110
114
max_concurrent_requests,
111
115
retry_config,
116
+ max_signature_channel_size,
117
+ max_transaction_channel_size,
112
118
}
113
119
}
114
120
@@ -118,6 +124,8 @@ impl ConnectionConfig {
118
124
polling_interval : Duration :: from_secs ( 5 ) ,
119
125
max_concurrent_requests : 5 ,
120
126
retry_config : RetryConfig :: default ( ) ,
127
+ max_signature_channel_size : None ,
128
+ max_transaction_channel_size : None ,
121
129
}
122
130
}
123
131
}
@@ -165,8 +173,16 @@ impl Datasource for RpcTransactionCrawler {
165
173
let sender = sender. clone ( ) ;
166
174
let commitment = self . commitment ;
167
175
168
- let ( signature_sender, signature_receiver) = mpsc:: channel ( 1000 ) ;
169
- let ( transaction_sender, transaction_receiver) = mpsc:: channel ( 1000 ) ;
176
+ let ( signature_sender, signature_receiver) = mpsc:: channel (
177
+ self . connection_config
178
+ . max_signature_channel_size
179
+ . unwrap_or ( 1000 ) ,
180
+ ) ;
181
+ let ( transaction_sender, transaction_receiver) = mpsc:: channel (
182
+ self . connection_config
183
+ . max_transaction_channel_size
184
+ . unwrap_or ( 1000 ) ,
185
+ ) ;
170
186
171
187
let signature_fetcher = signature_fetcher (
172
188
rpc_client. clone ( ) ,
0 commit comments