put method
Store a value in the cache.
Executes hooks in EventFlow order. Metadata controls hook behavior (TTL, encryption, etc).
Example:
await cache.put('user:123', {'name': 'Alice'});
await cache.put('session', token, metadata: {'ttl_seconds': 3600});
Implementation
Future<void> put(
String key,
dynamic value, {
Map<String, dynamic>? metadata,
}) async {
final ctx = PVCtx(
cache: this,
actionType: ActionType.put,
initialKey: key,
initialEntryValue: value,
initialMeta: metadata ?? {},
);
await ctx.queue(_orderedPutHooks);
}