OptionalgenerateOptional key generation function. If omitted, uses a built-in serializer that handles:
Unsupported types (serialized but may cause collisions):
For identity-based deduplication, functions as arguments, or performance-critical
hot paths, provide a custom generateKey that extracts only discriminating fields
(e.g., (id, _opts) => id).
OptionalonCalled when subsequent caller joins existing in-flight promise. Must be synchronous. Errors are silently caught.
OptionalonCalled when shared promise rejects. Must be synchronous. Errors are silently caught.
OptionalonCalled when shared promise resolves successfully. Must be synchronous. Errors are silently caught.
OptionalonCalled when first caller starts producer for this key (before producer executes). Must be synchronous. Errors are silently caught.
OptionalshouldPre-serialization check. Return false to bypass deduplication and execute the producer directly.
This is called BEFORE key generation/serialization. Use this for conditional deduplication based on request context or parameters.
Configuration options for in-flight promise deduplication.