@@ -137,6 +137,22 @@ pub struct Data {
137
137
pub publisher_buffer_key : Option < Pubkey > ,
138
138
}
139
139
140
+ fn default_handle_price_account_update_channel_size ( ) -> usize {
141
+ 1000
142
+ }
143
+
144
+ fn default_handle_price_account_update_worker_poll_size ( ) -> usize {
145
+ 50
146
+ }
147
+
148
+ fn default_subscriber_finished_min_time ( ) -> Duration {
149
+ Duration :: from_secs ( 30 )
150
+ }
151
+
152
+ fn default_subscriber_finished_sleep_time ( ) -> Duration {
153
+ Duration :: from_secs ( 1 )
154
+ }
155
+
140
156
#[ derive( Clone , Serialize , Deserialize , Debug ) ]
141
157
#[ serde( default ) ]
142
158
pub struct Config {
@@ -158,6 +174,19 @@ pub struct Config {
158
174
/// socket count at bay, the batches are looked up sequentially,
159
175
/// trading off overall time it takes to fetch all symbols.
160
176
pub max_lookup_batch_size : usize ,
177
+
178
+ /// Number of workers used to wait for the handle_price_account_update
179
+ #[ serde( default = "default_handle_price_account_update_worker_poll_size" ) ]
180
+ pub handle_price_account_update_worker_poll_size : usize ,
181
+ /// Channel size used to wait for the handle_price_account_update
182
+ #[ serde( default = "default_handle_price_account_update_channel_size" ) ]
183
+ pub handle_price_account_update_channel_size : usize ,
184
+ /// Minimum time for a subscriber to run
185
+ #[ serde( default = "default_subscriber_finished_min_time" ) ]
186
+ pub subscriber_finished_min_time : Duration ,
187
+ /// Time to sleep if the subscriber do not run for more than the minimum time
188
+ #[ serde( default = "default_subscriber_finished_sleep_time" ) ]
189
+ pub subscriber_finished_sleep_time : Duration ,
161
190
}
162
191
163
192
impl Default for Config {
@@ -169,6 +198,12 @@ impl Default for Config {
169
198
updates_channel_capacity : 10000 ,
170
199
data_channel_capacity : 10000 ,
171
200
max_lookup_batch_size : 100 ,
201
+ handle_price_account_update_worker_poll_size :
202
+ default_handle_price_account_update_worker_poll_size ( ) ,
203
+ handle_price_account_update_channel_size :
204
+ default_handle_price_account_update_channel_size ( ) ,
205
+ subscriber_finished_min_time : default_subscriber_finished_min_time ( ) ,
206
+ subscriber_finished_sleep_time : default_subscriber_finished_sleep_time ( ) ,
172
207
}
173
208
}
174
209
}
0 commit comments