MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / register_callback

Method register_callback

src/sql/src/session/vars.rs:1610–1620  ·  view source on GitHub ↗

Registers a closure that will get called when the value for the specified [`VarDefinition`] changes. The callback is guaranteed to be called at least once.

(
        &mut self,
        var: &VarDefinition,
        callback: Arc<dyn Fn(&SystemVars) + Send + Sync>,
    )

Source from the content-addressed store, hash-verified

1608 ///
1609 /// The callback is guaranteed to be called at least once.
1610 pub fn register_callback(
1611 &mut self,
1612 var: &VarDefinition,
1613 callback: Arc<dyn Fn(&SystemVars) + Send + Sync>,
1614 ) {
1615 self.callbacks
1616 .entry(var.name().to_string())
1617 .or_default()
1618 .push(callback);
1619 self.notify_callbacks(var.name());
1620 }
1621
1622 /// Notify any external components interested in this variable.
1623 fn notify_callbacks(&self, name: &str) {

Callers 1

serveFunction · 0.80

Calls 5

notify_callbacksMethod · 0.80
pushMethod · 0.45
entryMethod · 0.45
to_stringMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected