| 5388 | type SubscribePluginStartedStream = NotificationStream<pb::PluginStartedNotification>; |
| 5389 | |
| 5390 | async fn subscribe_plugin_started( |
| 5391 | &self, |
| 5392 | _request : tonic::Request<pb::StreamPluginStartedRequest> |
| 5393 | ) -> Result<tonic::Response<Self::SubscribePluginStartedStream>, tonic::Status> { |
| 5394 | let receiver = self.events.subscribe(); |
| 5395 | let stream = BroadcastStream::new(receiver); |
| 5396 | let boxed = Box::pin(stream); |
| 5397 | |
| 5398 | let result = NotificationStream { |
| 5399 | inner : boxed, |
| 5400 | fn_filter_map : |x| { |
| 5401 | match x { |
| 5402 | Notification::PluginStarted(x) => { |
| 5403 | Some(x.into()) |
| 5404 | } |
| 5405 | _ => None |
| 5406 | } |
| 5407 | } |
| 5408 | }; |
| 5409 | Ok(tonic::Response::new(result)) |
| 5410 | } |
| 5411 | |
| 5412 | |
| 5413 | type SubscribePluginStoppedStream = NotificationStream<pb::PluginStoppedNotification>; |