Exemplo n.º 1
0
        Task AddIndexAsync(IndexOptions indexOptions, CancellationToken cancellationToken)
        {
            if (indexOptions == null)
            {
                throw new ArgumentNullException(nameof(indexOptions));
            }

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

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