deriveRetentionKey#
Object deriveRetentionKey({
required dynamic module,
required dynamic context,
Object? explicitKey,
Object? parentKey,
dynamic args,
Map<String, Object?>? extras,
});
Derive a stable cache key for a Module within the retention system.
The key uniquely identifies a ModuleController within the ModuleRetainer cache. Identical keys cause the retainer to return the same cached controller.
Resolution Order#
- If
explicitKeyis provided, it is returned as-is. -
If the
moduleimplements RetentionIdentityProvider, its RetentionIdentityProvider.buildRetentionIdentity is called. A non-null result is returned directly. -
Otherwise a composite hash is computed from the module type,
Module.identityKey, the enclosing route,
args,parentKey, andextras.