// Register a channel to be notified when the specified keys are notified.
// Returns whether the caller was the first to register intent for the given
// keys.
// Register a channel to be notified when the specified keys are notified.
// Returns whether the caller was the first to register intent for the given
// keys.
// Cache checks should be done after registering intent, since it's possible to
// register Intent while a Notify is running, and the Notify is done after
// setting the cache.
// Cache checks should be done after registering intent, since it's possible to
// register Intent while a Notify is running, and the Notify is done after
// setting the cache.
-func (m *intentMapStruct) Intent(ch chan Cacheable, keys ...cacheKey) bool {
- key := cachePath(keys...)
+func (m *intentMapStruct) Intent(ch chan notification, keys ...fscache.CacheKey) bool {
+ key := intentKey(keys...)
//
// The intentStruct can be directly unlocked, or given to Free to also
// remove it from the intent map.
//
// The intentStruct can be directly unlocked, or given to Free to also
// remove it from the intent map.
-func (m *intentMapStruct) _lockIntent(keys ...cacheKey) *intentStruct {
- s, ok := m.m[cachePath(keys...)]
+func (m *intentMapStruct) _lockIntent(keys ...fscache.CacheKey) *intentStruct {
+ s, ok := m.m[intentKey(keys...)]
// Closes all channels that are listening for the specified keys
// and removes them from the intent map.
// Closes all channels that are listening for the specified keys
// and removes them from the intent map.
// Notifies all channels that are listening for the specified keys,
// but doesn't close or remove them from the intent map.
// Notifies all channels that are listening for the specified keys,
// but doesn't close or remove them from the intent map.