/// <summary> /// Invoke the passed <see cref="IEntryProcessor"/> against the set /// of entries that are selected by the given <see cref="IFilter"/>, /// returning the result of the invocation for each. /// </summary> /// <remarks> /// <p> /// Unless specified otherwise, IInvocableCache implementations /// will perform this operation in two steps: (1) use the filter to /// retrieve a matching entry collection; (2) apply the agent to /// every filtered entry. This algorithm assumes that the agent's /// processing does not affect the result of the specified filter /// evaluation, since the filtering and processing could be /// performed in parallel on different threads.</p> /// <p> /// If this assumption does not hold, the processor logic has to be /// idempotent, or at least re-evaluate the filter. This could be /// easily accomplished by wrapping the processor with the /// <see cref="ConditionalProcessor"/>.</p> /// <p> /// The operation always executes against the back cache.</p> /// </remarks> /// <param name="filter"> /// An <see cref="IFilter"/> that results in the collection of keys to /// be processed. /// </param> /// <param name="agent"> /// The <see cref="IEntryProcessor"/> to use to process the specified /// keys. /// </param> /// <returns> /// A cache containing the results of invoking the /// <b>IEntryProcessor</b> against the keys that are selected by the /// given <b>IFilter</b>. /// </returns> public virtual IDictionary InvokeAll(IFilter filter, IEntryProcessor agent) { return(BackCache.InvokeAll(filter, agent)); }
/// <summary> /// Invoke the passed <see cref="IEntryProcessor"/> against the /// entries specified by the passed keys, returning the result of the /// invocation for each. /// </summary> /// <remarks> /// The operation always executes against the back cache. /// </remarks> /// <param name="keys"> /// The keys to process; these keys are not required to exist within /// the cache. /// </param> /// <param name="agent"> /// The <b>IEntryProcessor</b> to use to process the specified keys. /// </param> /// <returns> /// A cache containing the results of invoking the /// <b>IEntryProcessor</b> against each of the specified keys. /// </returns> public virtual IDictionary InvokeAll(ICollection keys, IEntryProcessor agent) { return(BackCache.InvokeAll(keys, agent)); }