Пример #1
0
        public ISet <KeyValuePair <TKey, TValue> > EntrySet()
        {
            var request  = MapEntrySetCodec.EncodeRequest(GetName());
            var response = Invoke(request);

            var result = new ConcurrentQueue <KeyValuePair <IData, object> >();

            MapEntrySetCodec.DecodeResponse(response, result);
            return(new ReadOnlyLazyEntrySet <TKey, TValue>(result, GetContext().GetSerializationService()));
        }
Пример #2
0
        private async Task <IReadOnlyDictionary <TKey, TValue> > GetAsync(CancellationToken cancellationToken)
        {
            var requestMessage  = MapEntrySetCodec.EncodeRequest(Name);
            var responseMessage = await Cluster.Messaging.SendAsync(requestMessage, cancellationToken).CAF();

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

            return(new ReadOnlyLazyDictionary <TKey, TValue>(SerializationService)
            {
                response
            });
        }
Пример #3
0
        public ISet <KeyValuePair <TKey, TValue> > EntrySet()
        {
            var request  = MapEntrySetCodec.EncodeRequest(Name);
            var response = Invoke(request);

            var result = new List <KeyValuePair <IData, object> >();

            foreach (var kvp in MapEntrySetCodec.DecodeResponse(response).Response)
            {
                result.Add(new KeyValuePair <IData, object>(kvp.Key, kvp.Value));
            }
            return(new ReadOnlyLazyEntrySet <TKey, TValue, object>(result, Client.SerializationService));
        }
        public ISet <KeyValuePair <K, V> > EntrySet()
        {
            var request = MapEntrySetCodec.EncodeRequest(GetName());
            var entries = Invoke(request, m => MapEntrySetCodec.DecodeResponse(m).entrySet);
            ISet <KeyValuePair <K, V> > entrySet = new HashSet <KeyValuePair <K, V> >();

            foreach (var entry in entries)
            {
                var key   = ToObject <K>(entry.Key);
                var value = ToObject <V>(entry.Value);
                entrySet.Add(new KeyValuePair <K, V>(key, value));
            }
            return(entrySet);
        }