Beispiel #1
0
        private async Task <bool> RemoveInterceptorAsync(string id, CancellationToken cancellationToken)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentException(ExceptionMessages.NullOrEmpty, nameof(id));
            }

            var requestMessage  = MapRemoveInterceptorCodec.EncodeRequest(Name, id);
            var responseMessage = await Cluster.Messaging.SendAsync(requestMessage, cancellationToken).CfAwait();

            var response = MapRemoveInterceptorCodec.DecodeResponse(responseMessage).Response;

            return(response);
        }
Beispiel #2
0
        Task RemoveInterceptorAsync(string id, CancellationToken cancellationToken = default)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentException(ExceptionMessages.NullOrEmpty, nameof(id));
            }

            var requestMessage = MapRemoveInterceptorCodec.EncodeRequest(Name, id);
            var task           = Cluster.Messaging.SendAsync(requestMessage, cancellationToken);

#if HZ_OPTIMIZE_ASYNC
            return(task);
#else
            await task.CAF();
#endif
        }
        public void RemoveInterceptor(string id)
        {
            var request = MapRemoveInterceptorCodec.EncodeRequest(GetName(), id);

            Invoke(request);
        }