Refactor handling of ContextServer notifications
The notification handler registration is now more explicit, with handlers set up before server initialization to avoid potential race conditions.
This commit is contained in:
parent
f028ca4d1a
commit
81c111510f
4 changed files with 79 additions and 56 deletions
|
@ -115,10 +115,11 @@ impl InitializedContextServerProtocol {
|
|||
self.inner.notify(T::METHOD, params)
|
||||
}
|
||||
|
||||
pub fn on_notification<F>(&self, method: &'static str, f: F)
|
||||
where
|
||||
F: 'static + Send + FnMut(Value, AsyncApp),
|
||||
{
|
||||
pub fn on_notification(
|
||||
&self,
|
||||
method: &'static str,
|
||||
f: Box<dyn 'static + Send + FnMut(Value, AsyncApp)>,
|
||||
) {
|
||||
self.inner.on_notification(method, f);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue