(
&self,
sink: PendingSubscriptionSink,
)
| 66 | } |
| 67 | |
| 68 | async fn dev_subscribe_engine_queue_length( |
| 69 | &self, |
| 70 | sink: PendingSubscriptionSink, |
| 71 | ) -> SubscriptionResult { |
| 72 | let sink = sink.accept().await?; |
| 73 | |
| 74 | let mut subscription = self.engine_queue_length_watcher().await?; |
| 75 | |
| 76 | let mut current_queue_length = *subscription.borrow(); |
| 77 | |
| 78 | Self::send_queue_length_update(&sink, ¤t_queue_length).await?; |
| 79 | |
| 80 | while let Ok(new_queue_length) = subscription |
| 81 | .wait_for(|queue_length| queue_length != ¤t_queue_length) |
| 82 | .await |
| 83 | .map(|state| *state) |
| 84 | { |
| 85 | Self::send_queue_length_update(&sink, &new_queue_length).await?; |
| 86 | current_queue_length = new_queue_length; |
| 87 | } |
| 88 | |
| 89 | warn!(target: "rpc::dev::engine_queue_size", "Subscription to engine queue size has been closed."); |
| 90 | Ok(()) |
| 91 | } |
| 92 | } |
nothing calls this directly
no test coverage detected