diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-25 17:29:23 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-25 17:29:23 +0100 |
commit | b5aa92bab94880a289372c66c99117ae5e6e9e1f (patch) | |
tree | 70dc29d375136453569d35467a4ed31041727e30 /crates/vfs-notify | |
parent | ba7286345256eb1140853dc0daa3c276e2ddcbbe (diff) | |
parent | f5ea35a2710c78e77c81f491cc6f8abd40e33981 (diff) |
Merge #5064
5064: Add NotificationDispatcher r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/vfs-notify')
-rw-r--r-- | crates/vfs-notify/src/lib.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/vfs-notify/src/lib.rs b/crates/vfs-notify/src/lib.rs index 68fdb8cb0..25ba8d798 100644 --- a/crates/vfs-notify/src/lib.rs +++ b/crates/vfs-notify/src/lib.rs | |||
@@ -82,7 +82,12 @@ impl NotifyActor { | |||
82 | watcher_receiver, | 82 | watcher_receiver, |
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | fn next_event(&self, receiver: &Receiver<Message>) -> Option<Event> { | |
86 | select! { | ||
87 | recv(receiver) -> it => it.ok().map(Event::Message), | ||
88 | recv(&self.watcher_receiver) -> it => Some(Event::NotifyEvent(it.unwrap())), | ||
89 | } | ||
90 | } | ||
86 | fn run(mut self, inbox: Receiver<Message>) { | 91 | fn run(mut self, inbox: Receiver<Message>) { |
87 | while let Some(event) = self.next_event(&inbox) { | 92 | while let Some(event) = self.next_event(&inbox) { |
88 | log::debug!("vfs-notify event: {:?}", event); | 93 | log::debug!("vfs-notify event: {:?}", event); |
@@ -154,12 +159,6 @@ impl NotifyActor { | |||
154 | } | 159 | } |
155 | } | 160 | } |
156 | } | 161 | } |
157 | fn next_event(&self, receiver: &Receiver<Message>) -> Option<Event> { | ||
158 | select! { | ||
159 | recv(receiver) -> it => it.ok().map(Event::Message), | ||
160 | recv(&self.watcher_receiver) -> it => Some(Event::NotifyEvent(it.unwrap())), | ||
161 | } | ||
162 | } | ||
163 | fn load_entry( | 162 | fn load_entry( |
164 | &mut self, | 163 | &mut self, |
165 | entry: loader::Entry, | 164 | entry: loader::Entry, |