/// <summary>
        /// Add elements to a collection in batches and parallel between containers in the collection.
        /// </summary>
        /// <typeparam name="T">Type of items to add.</typeparam>
        /// <param name="collection">Collection to store items to.</param>
        /// <param name="elements">Items to be added.</param>
        /// <returns>Task that is completed after all items are added.</returns>
        public static async Task <List <ContainerElementReference <T> > > BatchAdd <T>(this IContainerGrain <T> collection, ICollection <T> elements)
        {
            var receivers = await collection.GetItemAdders();

            return(await BatchAdd(receivers, elements));
        }
Example #2
0
        /// <summary>
        /// Add elements to a collection in batches and parallel between containers in the collection.
        /// </summary>
        /// <typeparam name="T">Type of items to add.</typeparam>
        /// <param name="collection">Collection to store items to.</param>
        /// <param name="elements">Items to be added.</param>
        /// <returns>Task that is completed after all items are added.</returns>
        public static async Task <Dictionary <ContainerElementReference <T>, T> > BatchAddReturnDictionary <T>(this IContainerGrain <T> collection, IReadOnlyCollection <T> elements)
        {
            var receivers = await collection.GetItemAdders();

            return(await BatchAddReturnDictionary(receivers, elements));
        }