Esempio n. 1
0
        Task AddIndexAsync(IndexConfig indexConfig, CancellationToken cancellationToken)
        {
            if (indexConfig == null)
            {
                throw new ArgumentNullException(nameof(indexConfig));
            }

            var requestMessage = MapAddIndexCodec.EncodeRequest(Name, indexConfig.ValidateAndNormalize(Name));
            var task           = Cluster.Messaging.SendAsync(requestMessage, cancellationToken);

#if HZ_OPTIMIZE_ASYNC
            return(task);
#else
            await task.CAF();
#endif
        }