runSyncWithCorrelation<T> static method
- T fn(), {
- String? correlationId,
Runs the given synchronous function with a new correlation ID.
Similar to runWithCorrelation, but for synchronous code.
Implementation
static T runSyncWithCorrelation<T>(T Function() fn, {String? correlationId}) {
final id = correlationId ?? _generateId();
return runZoned(fn, zoneValues: {_correlationIdKey: id});
}