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