Redis
 sql >> डेटाबेस >  >> NoSQL >> Redis

रेडिस टाइप किए गए लेनदेन

सर्विसस्टैक के सी# रेडिस क्लाइंट द्वारा कार्यान्वित रेडिस लेनदेन इंटरफ़ेस।

परिचय #

रेडिस ट्रांजेक्शन इंटरफेस उपयोगी ओवरलोड प्रदान करता है जो आपको एक ही लेनदेन के भीतर किसी भी IRedisTypedClient ऑपरेशन को कतारबद्ध करने देता है। एपीआई कॉलबैक के लिए समर्थन प्रदान करता है ताकि आपके पास लेन-देन के हिस्से के रूप में लौटाए गए किसी भी रिटर्न वैल्यू तक भी पहुंच हो।

उपयोग #

नीचे एक सरल उदाहरण दिया गया है जिसमें दिखाया गया है कि लेन-देन तक कैसे पहुंचें, उपयोग करें और कैसे प्रतिबद्ध करें।

var typedClient = Redis.GetTypedClient<MyPocoType>();			
using (var trans = typedClient.CreateTransaction())
{
    trans.QueueCommand(r => r.Set("nosqldbs", new MyPocoType {Id = 1, Name = "Redis"));

    trans.Commit();
}

स्ट्रिंग मानों पर चलने वाले लेन-देन के लिए IRedisTransaction देखें।

विवरण #

public interface IRedisTypedTransaction<T> 
    : IDisposable
{
    void QueueCommand(Action<IRedisTypedClient<T>> command);
    void QueueCommand(Action<IRedisTypedClient<T>> command, Action onSuccessCallback);
    void QueueCommand(Action<IRedisTypedClient<T>> command, Action onSuccessCallback, Action<Exception> onErrorCallback);

    void QueueCommand(Func<IRedisTypedClient<T>, int> command);
    void QueueCommand(Func<IRedisTypedClient<T>, int> command, Action<int> onSuccessCallback);
    void QueueCommand(Func<IRedisTypedClient<T>, int> command, Action<int> onSuccessCallback, Action<Exception> onErrorCallback);

    void QueueCommand(Func<IRedisTypedClient<T>, bool> command);
    void QueueCommand(Func<IRedisTypedClient<T>, bool> command, Action<bool> onSuccessCallback);
    void QueueCommand(Func<IRedisTypedClient<T>, bool> command, Action<bool> onSuccessCallback, Action<Exception> onErrorCallback);

    void QueueCommand(Func<IRedisTypedClient<T>, double> command);
    void QueueCommand(Func<IRedisTypedClient<T>, double> command, Action<double> onSuccessCallback);
    void QueueCommand(Func<IRedisTypedClient<T>, double> command, Action<double> onSuccessCallback, Action<Exception> onErrorCallback);

    void QueueCommand(Func<IRedisTypedClient<T>, byte[]> command);
    void QueueCommand(Func<IRedisTypedClient<T>, byte[]> command, Action<byte[]> onSuccessCallback);
    void QueueCommand(Func<IRedisTypedClient<T>, byte[]> command, Action<byte[]> onSuccessCallback, Action<Exception> onErrorCallback);

    void QueueCommand(Func<IRedisTypedClient<T>, string> command);
    void QueueCommand(Func<IRedisTypedClient<T>, string> command, Action<string> onSuccessCallback);
    void QueueCommand(Func<IRedisTypedClient<T>, string> command, Action<string> onSuccessCallback, Action<Exception> onErrorCallback);

    void QueueCommand(Func<IRedisTypedClient<T>, T> command);
    void QueueCommand(Func<IRedisTypedClient<T>, T> command, Action<T> onSuccessCallback);
    void QueueCommand(Func<IRedisTypedClient<T>, T> command, Action<T> onSuccessCallback, Action<Exception> onErrorCallback);

    void QueueCommand(Func<IRedisTypedClient<T>, List<string>> command);
    void QueueCommand(Func<IRedisTypedClient<T>, List<string>> command, Action<List<string>> onSuccessCallback);
    void QueueCommand(Func<IRedisTypedClient<T>, List<string>> command, Action<List<string>> onSuccessCallback, Action<Exception> onErrorCallback);

    void QueueCommand(Func<IRedisTypedClient<T>, List<T>> command);
    void QueueCommand(Func<IRedisTypedClient<T>, List<T>> command, Action<List<T>> onSuccessCallback);
    void QueueCommand(Func<IRedisTypedClient<T>, List<T>> command, Action<List<T>> onSuccessCallback, Action<Exception> onErrorCallback);

    void Commit();
    void Rollback();
}

  1. Redis
  2.   
  3. MongoDB
  4.   
  5. Memcached
  6.   
  7. HBase
  8.   
  9. CouchDB
  1. मैं Node.js के माध्यम से Redis डेटाबेस के लिए HGET/GET कमांड कैसे जारी करूं?

  2. रेडिस में डेटा निर्देशिका कहाँ है?

  3. मैं वेबमाचिन और इरेडिस को एक साथ कैसे काम कर सकता हूं?

  4. रिक्त स्थान वाली कुंजियों का उपयोग करके रेडिस से मूल्य कैसे प्राप्त करें?

  5. कोडइग्निटर में रेडिस को कैसे कार्यान्वित करें?