currentContext static method
Returns the CausalityContext for the current execution context,
or null if not running inside a CausalityZone.run call.
Safe to call from anywhere — returns null outside causality zones instead of throwing.
Implementation
static CausalityContext? currentContext() {
return Zone.current[_causalityKey] as CausalityContext?;
}